std::never_stop_token
来自 cppreference.cn
定义于头文件 <stop_token> |
||
class never_stop_token; |
(C++26 起) | |
never_stop_token
类实现了 unstoppable_token
,它提供了一个静态信息,即停止永远不可能被请求。它是 std::get_stop_token
返回的默认停止令牌类型,如果在可查询对象中没有提供其他关联的停止令牌。
目录 |
[编辑] 成员别名模板
类型 | 定义 | ||||||
callback_type<Callback> | /*callback-type*/ 其中类型定义为
|
[编辑] 成员函数
stop_requested [静态] |
表示停止永远不会被请求 (公共静态成员函数) |
stop_possible [静态] |
表示停止是不可能的 (公共静态成员函数) |
operator== |
比较两个 never_stop_token 对象(公开成员函数) |
std::never_stop_token::stop_requested
static constexpr bool stop_requested() noexcept { return false; } |
||
始终返回 false,表示停止永远不会被请求。
std::never_stop_token::stop_possible
static constexpr bool stop_possible() noexcept { return false; } |
||
始终返回 false,表示停止是不可能的。
std::never_stop_token::operator==
bool operator==(const never_stop_token&) const = default; |
||
两个 never_stop_token
对象总是比较相等。
[编辑] 示例
本节不完整 原因:无示例 |