名稱空間
變體
操作

std::stop_token::operator=

來自 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 中已棄用)
原子操作的自由函式
原子標誌的自由函式
 
 
std::stop_token& operator=( const std::stop_token& other ) noexcept;
(1) (C++20 起)
std::stop_token& operator=( std::stop_token&& other ) noexcept;
(2) (C++20 起)

other 的關聯停止狀態替換當前物件的關聯停止狀態。

1)other 的關聯停止狀態複製賦值給 *this 的關聯停止狀態。等價於 stop_token(other).swap(*this)
2)other 的關聯停止狀態移動賦值給 *this 的關聯停止狀態。賦值後,*this 包含 other 之前的關聯停止狀態,而 other 不再具有關聯停止狀態。等價於 stop_token(std::move(other)).swap(*this)

[編輯] 引數

其他 - 另一個 stop_token 物件,用於共享或獲取停止狀態。