Documentation Home >> Headers >> <thread> Header >> std::thread >> swap Non-member function for std::threads

Exchanges ownership of their associated threads of execution between two std::thread objects.

void swap(thread& lhs,thread& rhs);

Effects:

lhs.swap(rhs)

Throws:

Nothing

Header

#include <thread>

See Also