std::stop_source::operator=
来自cppreference.com
< cpp | thread | stop source
并发支持库
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::stop_source
| 成员函数 | ||||
|
stop_source::operator=
|
||||
| 修改器 | ||||
| 观察器 | ||||
| 非成员函数 | ||||
| 辅助常量 | ||||
| 辅助类 | ||||
|
std::stop_source&
operator=(
const
std::stop_source&
other )
noexcept;
|
(1) | (C++20 起) |
|
std::stop_source&
operator=(
std::stop_source&&
other )
noexcept;
|
(2) | (C++20 起) |
以 other 的停止状态替换停止状态。
1) 复制赋值
other 的停止状态给
*this 的。等价于
stop_source(other).swap(*this) 。2) 移动赋值
other 的停止状态给
*this 的。赋值后,
*this 含有
other 先前的停止状态,而 other 无停止状态。等价于 stop_source(std::move(other)).swap(*this) 。参数
| other | - | 要共享停止状态或获得停止状态的另一 stop_source 对象
|