std::stop_token::operator=

< cpp‎ | thread‎ | stop token
std::stop_token& operator=( const std::stop_token& other ) noexcept;
(1) (C++20 起)
std::stop_token& operator=( std::stop_token&& other ) noexcept;
(2) (C++20 起)

other 的关联停止状态替换关联停止状态。

1) 复制赋值 other 的关联停止状态给 *this 的。等价于 stop_token(other).swap(*this)
2) 移动赋值 other 的关联停止状态给 *this 的。赋值后 *this 含有先前 other 的关联停止状态,而 other 无关联停止状态。等价于 stop_token(std::move(other)).swap(*this)

异常

(无)