Difference between revisions of "cpp/utility/pair/swap2"
From cppreference.com
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}} | ||
− | {{ | + | {{dcl begin}} |
− | {{ | + | {{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 ); | ||
}} | }} | ||
− | {{ | + | {{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=== | ||
− | {{ | + | {{par begin}} |
− | {{ | + | {{par | lhs, rhs | pairs whose contents to swap}} |
− | {{ | + | {{par end}} |
===Return value=== | ===Return value=== | ||
Line 23: | Line 23: | ||
===See also=== | ===See also=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc end}} |
[[de:cpp/utility/pair/swap2]] | [[de:cpp/utility/pair/swap2]] |
Revision as of 20:17, 31 May 2013
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)))