Namespaces
Variants
Views
Actions

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.)
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 {{tt|lhs}} with that of {{tt|rhs}}. Effectively calls {{c|lhs.swap(rhs)}}.
+
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=
+
|code=
| output=
+
|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}}
  
[[de:cpp/io/basic filebuf/swap2]]
+
{{langlinks|de|es|fr|it|ja|pt|ru|zh}}
[[es:cpp/io/basic filebuf/swap2]]
+
[[fr:cpp/io/basic filebuf/swap2]]
+
[[it:cpp/io/basic filebuf/swap2]]
+
[[ja:cpp/io/basic filebuf/swap2]]
+
[[pt:cpp/io/basic filebuf/swap2]]
+
[[ru:cpp/io/basic filebuf/swap2]]
+
[[zh:cpp/io/basic filebuf/swap2]]
+

Latest revision as of 00:38, 16 August 2023

 
 
 
 
template< class CharT, class Traits >

void swap( std::basic_filebuf<CharT,Traits>& lhs,

           std::basic_filebuf<CharT,Traits>& rhs );
(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

[edit] See also

(C++11)
swaps two basic_filebuf objects
(public member function) [edit]
swaps the values of two objects
(function template) [edit]