名前空間
変種
操作

std::jthread::operator=

提供: cppreference.com
< cpp‎ | thread‎ | jthread
 
 
スレッドサポートライブラリ
スレッド
(C++11)
(C++20)
(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++11)
セマフォ
ラッチとバリア
(C++20)
(C++20)
フューチャー
(C++11)
(C++11)
(C++11)
 
 
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 はもはやいかなるスレッドも表さなくなり、停止状態も持たなくなります。

[編集]引数

other - この jthread オブジェクトに代入する別の jthread オブジェクト。

[編集]戻り値

*this

close