std::stop_source::operator=
來自 cppreference.com
< cpp | thread | stop source
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 物件 |