<thread>

function
<thread>

std::swap (thread)

void swap (thread& x, thread& y) noexcept;
Swap threads
Exchanges the state of the thread objects x and y.

This is an overload of swap that behaves as if x.swap(y) was called.

Parameters

x,y
thread objects to swap.

Return value

none

Data races

Both objects, x and y, are modified.

Exception safety

No-throw guarantee: never throws exceptions.

See also