Difference between revisions of "cpp/thread/promise/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 6: | Line 6: | ||
}} | }} | ||
− | Specializes the {{ | + | Specializes the {{lc|std::swap}} algorithm for {{lc|std::promise}}. Exchanges the shared state of {{tt|lhs}} with that of {{tt|rhs}}. Effectively calls {{c|lhs.swap(rhs)}}. |
===Parameters=== | ===Parameters=== | ||
− | {{ | + | {{par begin}} |
− | {{ | + | {{par | lhs, rhs | promises whose states to swap}} |
− | {{ | + | {{par end}} |
===Return value=== | ===Return value=== | ||
Line 26: | Line 26: | ||
===See also=== | ===See also=== | ||
− | {{ | + | {{dsc begin}} |
− | {{ | + | {{dsc inc | cpp/thread/promise/dcl list swap}} |
− | {{ | + | {{dsc end}} |
[[de:cpp/thread/promise/swap2]] | [[de:cpp/thread/promise/swap2]] |
Revision as of 20:01, 31 May 2013
Defined in header <future>
|
||
template< class R > void swap( promise<R> &lhs, promise<R> &rhs ); |
(since C++11) | |
Specializes the std::swap algorithm for std::promise. Exchanges the shared state of lhs
with that of rhs
. Effectively calls lhs.swap(rhs).
Contents |
Parameters
lhs, rhs | - | promises whose states to swap |
Return value
(none)
Exceptions
noexcept specification:
noexcept
Example
This section is incomplete Reason: no example |