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 ;
(depuis C++20)

Si * this possède encore un thread associé en cours d'exécution (c'est-à-dire si joinable ( ) == true ), appelle request_stop ( ) suivi de join ( ) . Attribue l'état de other à * this et définit other à un état construit par défaut.

Après cet appel, this - > get_id ( ) est égal à la valeur de other. get_id ( ) avant l'appel et l'état d'arrêt associé est également déplacé, et other ne représente plus un thread d'exécution ni ne possède d'état d'arrêt.

Paramètres

autre - un autre jthread objet à assigner à cet jthread objet

Valeur de retour

* this