public member function
<future>

std::promise::swap

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

参数

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

返回值



数据竞争

x 和该对象都将被修改。

异常安全

无异常保证: 绝不抛出异常。

另见