std::shared_lock<Mutex>::operator=
來自 cppreference.com
< cpp | thread | shared_lock
shared_lock& operator=( shared_lock&& other ) noexcept; |
(C++14 起) | |
移動賦值運算子。等價於 shared_lock{std::move(other)}.swap(*this); return *this;。
如果 other 與 *this 是同一個物件,則沒有效果。
否則,如果在此呼叫之前 *this 擁有相關聯的互斥體(mutex() 返回非空指標)且已獲得其所有權(owns() 返回 true),則透過呼叫 unlock_shared() 解鎖互斥體。在此呼叫之後,other 沒有關聯的互斥體。
[編輯] 引數
其他 | - | 另一個 shared_lock 用來替換狀態 |
[編輯] 返回值
*this
[編輯] 缺陷報告
下列更改行為的缺陷報告追溯地應用於以前出版的 C++ 標準。
缺陷報告 | 應用於 | 釋出時的行為 | 正確的行為 |
---|---|---|---|
LWG 4172 | C++14 | shared_lock 的自移動賦值被錯誤地指定 |
重新指定為無操作 |