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
はもはやいかなるスレッドも表さなくなり、停止状態も持たなくなります。
[編集]引数
other | - | この jthread オブジェクトに代入する別の jthread オブジェクト。 |
[編集]戻り値
*this。