◐ Shell
clean mode source ↗

std::never_stop_token - cppreference.com

来自cppreference.com

never_stop_token 实现了 unstoppable_token,提供不可能停止且不能请求停止的静态信息。这是 std::get_stop_token 在可查询对象中未提供其他关联停止令牌的情况下所返回的缺省停止令牌类型。

成员别名模板

类型 定义
callback_type<Callback> /*callback-type*/
该类型定义如下:
struct /*callback-type*/
{
    explicit /*callback-type*/( never_stop_token,
                                auto&& ) noexcept {}
};
(仅用于阐述*)

成员函数

指示不能发起停止请求
(公开静态成员函数)
指示不可能停止
(公开静态成员函数)
比较两个 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 对象比较始终相等。

示例