Namespaces
Variants

std::jthread:: operator=

From cppreference.net
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
Generic lock management
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
Safe reclamation
Hazard pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11) (deprecated in C++20)
(C++11) (deprecated in C++20)
Memory ordering
(C++11) (deprecated in C++26)
Free functions for atomic operations
Free functions for atomic flags
std:: jthread & operator = ( std:: jthread && other ) noexcept ;
(C++20以降)

* this がまだ関連付けられた実行スレッドを持っている場合(つまり joinable ( ) == true )、 request_stop ( ) に続いて join ( ) を呼び出します。 other の状態を * this に代入し、 other をデフォルト構築された状態に設定します。

この呼び出しの後、 this - > get_id ( ) は呼び出し前の other. get_id ( ) の値と等しくなり、関連するstop-stateも移動されます。また、 other はもはや実行スレッドを表さず、stop-stateも持ちません。

パラメータ

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

戻り値

* this