std::shared_lock<Mutex>::operator=
来自 cppreference.cn
< 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 的自移动赋值被错误地指定 |
重新指定为无操作 |