std::stop_token::stop_token
來自 cppreference.com
< cpp | thread | stop token
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) *this 和 other 共享同一個關聯的停止狀態,且比較結果為相等。
3) *this 擁有 other 先前關聯的停止狀態,並且 other.stop_possible() 為 false。