名稱空間
變體
操作

std::stoppable_token

來自 cppreference.com
< cpp‎ | thread
 
 
併發支援庫
執行緒
(C++11)
(C++20)
this_thread 名稱空間
(C++11)
(C++11)
(C++11)
協同取消
stoppable_token
(C++26)
互斥
(C++11)
通用鎖管理
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
條件變數
(C++11)
訊號量
門閂和屏障
(C++20)
(C++20)
期值
(C++11)
(C++11)
(C++11)
(C++11)
安全回收
(C++26)
危險指標
原子型別
(C++11)
(C++20)
原子型別的初始化
(C++11)(C++20 中已棄用)
(C++11)(C++20 中已棄用)
記憶體排序
(C++11)(C++26 中已棄用)
原子操作的自由函式
原子標誌的自由函式
 
定義於標頭檔案 <stop_token>
template< class Token >

concept stoppable_token =
    requires (const Token tok) {
        typename /*check-type-alias-exists*/<Token::template callback_type>;
        { tok.stop_requested() } noexcept -> std::same_as<bool>;
        { tok.stop_possible() } noexcept -> std::same_as<bool>;
        { Token(tok) } noexcept; // see implicit expression variations
    } &&
    std::copyable<Token> &&

    std::equality_comparable<Token>;
(C++26 起)
幫助模板
template< template<class> class >
struct /*check-type-alias-exists*/; // not defined
(僅作說明*)

概念 stoppable_token<Token> 指定了一個停止令牌的基本介面,該令牌是 可複製的可相等比較的,並允許輪詢以檢視停止請求是否可能以及請求是否已發出。

[編輯] 語義要求

[編輯] 參閱

指定不允許停止的停止令牌
(concept) [編輯]