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

Falls * this noch einen assoziierten laufenden Thread besitzt (d.h. joinable ( ) == true ), ruft request_stop ( ) gefolgt von join ( ) auf. Weist den Zustand von other an * this zu und setzt other auf einen standardkonstruierten Zustand.

Nach diesem Aufruf ist this - > get_id ( ) gleich dem Wert von other. get_id ( ) vor dem Aufruf und der zugehörige Stop-Zustand wird ebenfalls verschoben, und other repräsentiert keinen Thread mehr noch besitzt es einen Stop-Zustand.

Parameter

other - ein weiteres jthread Objekt, das diesem jthread Objekt zugewiesen werden soll

Rückgabewert

* this