Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | utility‎ | pair
m (Text replace - "{{noexcept" to "{{unreviewed noexcept")
(merge noexcept)
Line 3: Line 3:
 
{{ddcl | header=utility | since=c++11 |
 
{{ddcl | header=utility | since=c++11 |
 
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 ) noexcept(/* see below */);
 
}}
 
}}
  
Line 17: Line 17:
  
 
===Exceptions===
 
===Exceptions===
{{unreviewed noexcept|noexcept(lhs.swap(rhs))}}
+
{{noexcept|noexcept(lhs.swap(rhs))}}
  
 
===See also===
 
===See also===

Revision as of 12:43, 1 May 2017

 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
 
Defined in header <utility>
template< class T1, class T2 >
void swap( pair<T1,T2>& lhs, pair<T1,T2>& rhs ) noexcept(/* see below */);
(since C++11)

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]