std::future<T>::operator=

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

赋值另一 future 对象的内容。

1) 释放任何共享状态并移动赋值 other 的内容给 *this 。赋值后, other.valid() == falsethis->valid() 将产生与 other.valid() 在赋值前相同的值。

2) std::future可复制赋值 (CopyAssignable)

参数

other - 将转移状态给 *thisstd::future

返回值

*this