std::promise<R>::operator=

< cpp‎ | thread‎ | promise
promise& operator=( promise&& other ) noexcept;
(1) (C++11 起)
promise& operator=( const promise& rhs ) = delete;
(2) (C++11 起)

赋值内容。

1) 移动赋值运算符。首先,抛弃共享状态(如在 ~promise() 中),然后如同以执行 std::promise(std::move(other)).swap(*this) 对共享状态赋值。
2) std::promise 不可复制赋值。

参数

other - 另一 std::promise 对象,为获取状态的来源

返回值

*this