Documentation Home >> Headers >> <jss/joining_thread.hpp> Header >> jss::joining_thread >> jss::joining_thread Move-Assignment Operator

Transfers ownership of a thread of execution from one jss::joining_thread object to another jss::joining_thread object.

joining_thread& operator=(joining_thread&& other);

Effects:

If this->joinable() would return true prior to the call, calls this->join() to wait for the thread to finish. If other has an associated thread of execution prior to the assignment, that thread of execution is now associated with *this. Otherwise *this has no associated thread of execution.

Postconditions:

this->get_id() is equal to the value of other.get_id() prior to the call. other.get_id()==id().

Throws:

Nothing

Note:

jss::joining_thread objects are not CopyAssignable, so there is no copy-assignment operator, only this move-assignment operator.

Header

#include <jss/joining_thread.hpp>

See Also