std::stop_token:: stop_token
From cppreference.net
<
cpp
|
thread
|
stop token
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::stop_token
| Member functions | ||||
|
stop_token::stop_token
|
||||
| Modifiers | ||||
| Observers | ||||
| Non-member functions | ||||
|
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)
拷贝构造函数。构造一个
stop_token
,其关联的停止状态与
other
相同。
3)
移动构造函数。构造一个
stop_token
,其关联停止状态与
other
相同;
other
将变为空状态。
参数
| 其他 | - |
用于构造此
stop_token
对象的另一个
stop_token
对象
|
后置条件
1)
stop_possible()
与
stop_requested()
均为
false
。
2)
*
this
与
other
共享相同的关联停止状态且比较结果相等。
3)
*
this
具有
other
先前关联的停止状态,且
other.
stop_possible
(
)
为
false
。