Difference between revisions of "cpp/thread/shared lock/swap"
From cppreference.com
< cpp | thread | shared lock
m (Text replace - "{{noexcept" to "{{unreviewed noexcept") |
Andreas Krug (Talk | contribs) m (fmt) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{cpp/thread/shared_lock/title|swap}} | {{cpp/thread/shared_lock/title|swap}} | ||
{{cpp/thread/shared_lock/navbar}} | {{cpp/thread/shared_lock/navbar}} | ||
− | {{ddcl | since=c++14 | | + | {{ddcl|since=c++14| |
template< class Mutex > | template< class Mutex > | ||
− | void swap( shared_lock<Mutex>& other ); | + | void swap( shared_lock<Mutex>& other ) ; |
}} | }} | ||
Line 10: | Line 10: | ||
===Parameters=== | ===Parameters=== | ||
{{par begin}} | {{par begin}} | ||
− | {{par | other | the lock to swap the state with}} | + | {{par|other|the lock to swap the state with}} |
{{par end}} | {{par end}} | ||
===Return value=== | ===Return value=== | ||
(none) | (none) | ||
− | |||
− | |||
− | |||
===Example=== | ===Example=== | ||
− | {{example | + | {{example}} |
− | + | ||
− | + | ||
− | + | ||
− | }} | + | |
===See also=== | ===See also=== | ||
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc inc | cpp/thread/shared_lock/dsc swap2}} | + | {{dsc inc|cpp/thread/shared_lock/dsc swap2}} |
{{dsc end}} | {{dsc end}} | ||
− | + | deesfritjaptruzh | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + |
Latest revision as of 11:06, 23 October 2023
template< class Mutex > void swap( shared_lock<Mutex>& other ) noexcept; |
(since C++14) | |
Exchanges the internal states of the lock objects.
Contents |
[edit] Parameters
other | - | the lock to swap the state with |
[edit] Return value
(none)
[edit] Example
This section is incomplete Reason: no example |
[edit] See also
(C++14) |
specializes the std::swap algorithm (function template) |