Transfers ownership of a thread of execution from one std::thread object to a newly-created
std::thread
object.
thread(thread&& other);
- Effects:
Constructs a
std::threadinstance. Ifotherhas an associated thread of execution prior to the constructor invocation, that thread of execution is now associated with the newly-createdstd::threadobject. Otherwise the newly-createdstd::threadobject has no associated thread of execution.- Postconditions:
For a newly-constructed
std::threadobjectx,x.get_id()is equal to the value ofother.get_id()prior to the constructor invocation.other.get_id()==id().- Throws:
Nothing
- Note:
std::threadobjects are notCopyConstructible, so there is no copy-constructor, only this move constructor
Header
#include <thread>