public member function
<future>

std::promise::swap

void swap (promise& x) noexcept;
Swap shared states
Exchanges the shared state (if any) with x.

Parameters

x
Another promise object of the same type (with the same template parameter T).

Return value

none

Data races

Both x and the object are modified.

Exception safety

No-throw guarantee: never throws exceptions.

See also