std::stop_source::operator=
来自cppreference.com
< cpp | thread | stop source
并发支持库
|
|
std::stop_source& operator=(conststd::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 对象 |