|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
jthread::operator= | ||||
| Observers | ||||
| Operations | ||||
| Stop token handling | ||||
| Non-member functions | ||||
std::jthread& operator=(std::jthread&& other)noexcept; | (since C++20) | |
If*this still has an associated running thread (i.e.joinable()==true), callsrequest_stop() followed byjoin(). Assigns the state ofother to*this and setsother to a default constructed state.
After this call,this->get_id() is equal to the value ofother.get_id() prior to the call and the associated stop-state is also moved, andother no longer represents a thread of execution nor has any stop-state.
| other | - | anotherjthread object to assign to thisjthread object |
*this