Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | utility‎ | pair
m (r2.7.3) (Robot: Adding de, es, fr, it, ja, pt, ru, zh)
m (Shorten template names. Use {{lc}} where appropriate.)
Line 1: Line 1:
 
{{cpp/title | swap<small>(std::pair)</small>}}
 
{{cpp/title | swap<small>(std::pair)</small>}}
 
{{cpp/utility/pair/navbar}}
 
{{cpp/utility/pair/navbar}}
{{ddcl list begin}}
+
{{dcl begin}}
{{ddcl list item |
+
{{dcl |
 
template< class T1, class T2 >
 
template< class T1, class T2 >
 
void swap( pair<T1,T2>& lhs, pair<T1,T2>& rhs );
 
void swap( pair<T1,T2>& lhs, pair<T1,T2>& rhs );
 
}}
 
}}
{{ddcl list end}}
+
{{dcl end}}
  
 
Swaps the contents of {{tt|lhs}} and {{tt|rhs}}. Equivalent to {{c|lhs.swap(rhs)}}.
 
Swaps the contents of {{tt|lhs}} and {{tt|rhs}}. Equivalent to {{c|lhs.swap(rhs)}}.
  
 
===Parameters===
 
===Parameters===
{{param list begin}}
+
{{par begin}}
{{param list item | lhs, rhs | pairs whose contents to swap}}
+
{{par | lhs, rhs | pairs whose contents to swap}}
{{param list end}}  
+
{{par end}}  
  
 
===Return value===
 
===Return value===
Line 23: Line 23:
 
===See also===
 
===See also===
  
{{dcl list begin}}
+
{{dsc begin}}
{{dcl list end}}
+
{{dsc end}}
  
 
[[de:cpp/utility/pair/swap2]]
 
[[de:cpp/utility/pair/swap2]]

Revision as of 20:17, 31 May 2013

 
 
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(x.swap(y)))

See also