名稱空間
變體
操作

std::stop_token::stop_token

來自 cppreference.com
< cpp‎ | thread‎ | stop token
 
 
併發支援庫
執行緒
(C++11)
(C++20)
this_thread 名稱空間
(C++11)
(C++11)
(C++11)
協同取消
互斥
(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() 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) *thisother 共享同一個關聯的停止狀態,且比較結果為相等。
3) *this 擁有 other 先前關聯的停止狀態,並且 other.stop_possible()false