std::shared_lock<Mutex>:: operator=
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
|
shared_lock::operator=
|
||||
| Shared locking | ||||
| Modifiers | ||||
| Observers | ||||
| Non-member functions | ||||
|
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
的自移动赋值规范存在错误
|
重新规范为无操作 |