std::never_stop_token
來自 cppreference.com
| 定義於標頭檔案 <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 物件總是比較相等。
[編輯] 示例
| 本節不完整 原因:無示例 |