Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/utility/pair/swap2"

From cppreference.com
< cpp‎ | utility‎ | pair
(noexcept)
m (use consistent parameter names, -noexcept rev, +see also)
Line 19: Line 19:
  
 
===Exceptions===
 
===Exceptions===
{{rev begin}}
+
{{noexcept|noexcept(lhs.swap(rhs))}}
{{rev | until=c++11 | (none)}}
+
{{rev | since=c++11 | {{noexcept|noexcept(x.swap(y))}}}}
+
{{rev end}}
+
  
 
===See also===
 
===See also===
 
{{dsc begin}}
 
{{dsc begin}}
 +
{{dsc inc|cpp/algorithm/dsc swap}}
 
{{dsc end}}
 
{{dsc end}}
  

Revision as of 04:02, 13 July 2014

 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
 
template< class T1, class T2 >
void swap( pair<T1,T2>& lhs, pair<T1,T2>& rhs );

Swaps the contents of lhs and rhs. Equivalent to lhs.swap(rhs).

Contents

Parameters

lhs, rhs - pairs whose contents to swap

Return value

(none)

Exceptions

noexcept specification:  
noexcept(noexcept(lhs.swap(rhs)))

See also

swaps the values of two objects
(function template) [edit]