std::stop_token::stop_token
来自cppreference.com
< cpp | thread | stop token
并发支持库
|
|
std::stop_token
成员函数 | ||||
stop_token::stop_token
|
||||
修改器 | ||||
观察器 | ||||
非成员函数 | ||||
stop_token()
noexcept;
|
(1) | (C++20 起) |
stop_token(
const
stop_token&
other )
noexcept;
|
(2) | (C++20 起) |
stop_token(
stop_token&&
other )
noexcept;
|
(3) | (C++20 起) |
构造新的 stop_token
对象。
1) 构造无关联停止状态的空
stop_token
。2) 复制构造函数。构造关联停止状态与
other
相同的 stop_token
。3) 移动构造函数。构造关联停止状态与
other
相同的 stop_token
;将 other
置于空状态。参数
other | - | 用于构造此 stop_token 对象的另一 stop_token
对象
|
后条件
1) stop_possible() 与 stop_requested() 均为 false
2) *this 与
other
共享同一停止状态且比较相等3) *this 拥有
other
先前的停止状态,而 other.stop_possible() 为 false