「cpp/thread/unique lock/swap2」の版間の差分
提供: cppreference.com
< cpp | thread | unique lock
TranslationBot (トーク | 投稿記録) (Translated from the English version using Google Translate) |
|||
(2人の利用者による、間の4版が非表示) | |||
1行: | 1行: | ||
− | |||
{{cpp/title | swap<small>(std::unique_lock)</small>}} | {{cpp/title | swap<small>(std::unique_lock)</small>}} | ||
{{cpp/thread/unique_lock/navbar}} | {{cpp/thread/unique_lock/navbar}} | ||
− | {{ | + | {{begin}} |
− | {{ | + | {{| |
template< class Mutex > | template< class Mutex > | ||
− | void swap( unique_lock<Mutex> &lhs, | + | void swap( unique_lock<Mutex>& lhs, |
− | unique_lock<Mutex> &rhs ); | + | unique_lock<Mutex>& rhs ) ; |
}} | }} | ||
− | {{ | + | {{end}} |
− | {{ | + | {{|std::swap}} {{|std::unique_lock}} {{tt|lhs}} {{tt|rhs}} {{c|lhs.swap(rhs)}} |
− | === | + | ====== |
− | {{ | + | {{begin}} |
− | {{ | + | {{| lhs, rhs | }} |
− | {{ | + | {{end}} |
− | === | + | ====== |
− | + | () | |
− | + | ||
− | + | ||
− | + | ||
===例=== | ===例=== | ||
29行: | 25行: | ||
}} | }} | ||
− | === | + | ====== |
− | {{ | + | {{begin}} |
− | {{ | + | {{| cpp/thread/unique_lock/swap}} |
− | {{ | + | {{end}} |
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ |
2018年4月7日 (土) 01:14時点における最新版
template< class Mutex > void swap( unique_lock<Mutex>& lhs, |
(C++11以上) | |
std::swap アルゴリズムを std::unique_lock に対して特殊化します。 lhs
と rhs
の状態を交換します。 実質的に lhs.swap(rhs) を呼びます。
目次 |
[編集] 引数
lhs, rhs | - | 状態を入れ替えるロックラッパー |
[編集] 戻り値
(なし)
[編集] 例
This section is incomplete Reason: no example |
[編集] 関連項目
別の std::unique_lock と状態を入れ替えます (パブリックメンバ関数) |