std::jthread::operator=
來自 cppreference.com
std::jthread& operator=( std::jthread&& other ) noexcept; |
(C++20 起) | |
如果 *this 仍然具有關聯的執行執行緒(即 joinable() == true),則呼叫 request_stop(),接著呼叫 join()。將 other 的狀態賦值給 *this,並將 other 設定為預設構造的狀態。
在此呼叫之後,this->get_id() 等於呼叫前 other.get_id() 的值,並且關聯的停止狀態也被移動,而 other 不再表示執行執行緒,也不再具有任何停止狀態。
[編輯] 引數
其他 | - | 另一個要賦值給此 jthread 物件的 jthread 物件 |
[編輯] 返回值
*this