名前空間
変種
操作

std::jthread::operator=

提供: cppreference.com
< cpp‎ | thread‎ | jthread
2019年12月28日 (土) 12:23時点におけるMilkpot (トーク | 投稿記録)による版

(差分) ←前の版 | 最新版 (差分) | 次の版→ (差分)
 
 
スレッドサポートライブラリ
スレッド
(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++11)
条件変数
(C++11)
セマフォ
ラッチとバリア
(C++20)
(C++20)
フューチャー
(C++11)
(C++11)
(C++11)
(C++11)
 
 
jthread& operator=( 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