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 和該物件都將被修改。

異常安全

無異常保證: 絕不丟擲異常。

另見