Difference between revisions of "cpp/io/basic filebuf/swap2"
From cppreference.com
< cpp | io | basic filebuf
m (Use since= and until= params of {{dcl}} template.) |
Andreas Krug (Talk | contribs) m (fmt, {{c}}, langlinks) |
||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
− | {{cpp/title | swap<small>(std::basic_filebuf)</small>}} | + | {{cpp/title|swap<small>(std::basic_filebuf)</small>}} |
{{cpp/io/basic_filebuf/navbar}} | {{cpp/io/basic_filebuf/navbar}} | ||
{{dcl begin}} | {{dcl begin}} | ||
− | {{dcl | since=c++11 | | + | {{dcl|since=c++11| |
template< class CharT, class Traits > | template< class CharT, class Traits > | ||
− | void swap( std::basic_filebuf<CharT, Traits>& lhs, | + | void swap( std::basic_filebuf<CharT,Traits>& lhs, |
− | std::basic_filebuf<CharT, Traits>& rhs ); | + | std::basic_filebuf<CharT,Traits>& rhs ); |
}} | }} | ||
{{dcl end}} | {{dcl end}} | ||
− | Overloads the {{lc|std::swap}} algorithm for {{lc|std::basic_filebuf}}. Exchanges the state of {{ | + | Overloads the {{lc|std::swap}} algorithm for {{lc|std::basic_filebuf}}. Exchanges the state of {{c|lhs}} with that of {{c|rhs}}. Effectively calls {{c|lhs.swap(rhs)}}. |
===Parameters=== | ===Parameters=== | ||
{{par begin}} | {{par begin}} | ||
− | {{par | lhs, rhs | {{lc|std::basic_filebuf}} objects whose states to swap}} | + | {{par|lhs, rhs|{{lc|std::basic_filebuf}} objects whose states to swap}} |
{{par end}} | {{par end}} | ||
Line 21: | Line 21: | ||
===Example=== | ===Example=== | ||
{{example | {{example | ||
− | + | |code= | |
− | + | |output= | |
}} | }} | ||
===See also=== | ===See also=== | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc inc | cpp/io/basic_filebuf/dsc swap}} | + | {{dsc inc|cpp/io/basic_filebuf/dsc swap}} |
− | {{dsc inc | cpp/algorithm/dsc swap}} | + | {{dsc inc|cpp/algorithm/dsc swap}} |
{{dsc end}} | {{dsc end}} | ||
− | + | {{langlinks|de|es|fr|it|ja|pt|ru|zh}} | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + |
Latest revision as of 00:38, 16 August 2023
template< class CharT, class Traits > void swap( std::basic_filebuf<CharT,Traits>& lhs, |
(since C++11) | |
Overloads the std::swap algorithm for std::basic_filebuf. Exchanges the state of lhs with that of rhs. Effectively calls lhs.swap(rhs).
Contents |
[edit] Parameters
lhs, rhs | - | std::basic_filebuf objects whose states to swap |
[edit] Return value
(none)
[edit] Example
This section is incomplete Reason: no example |
[edit] See also
(C++11) |
swaps two basic_filebuf objects (public member function) |
swaps the values of two objects (function template) |