名稱空間
變體
操作

std::stop_source::operator=

來自 cppreference.com
< cpp‎ | thread‎ | stop source
 
 
併發支援庫
執行緒
(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_source& operator=( const std::stop_source& other ) noexcept;
(1) (C++20 起)
std::stop_source& operator=( std::stop_source&& other ) noexcept;
(2) (C++20 起)

將停止狀態替換為 other 的停止狀態。

1) 複製賦值 other 的停止狀態給 *this 的停止狀態。等價於 stop_source(other).swap(*this)
2) 移動賦值 other 的停止狀態給 *this 的停止狀態。賦值後,*this 包含 other 先前的停止狀態,而 other 沒有停止狀態。等價於 stop_source(std::move(other)).swap(*this)

[編輯] 引數

其他 - 另一個用於共享停止狀態或從中獲取停止狀態的 stop_source 物件