std::shared_future<T>::operator=
来自 cppreference.cn
< cpp | thread | shared_future
(1) | ||
shared_future& operator=( const shared_future& other ); |
(C++11 起) (C++17 前) |
|
shared_future& operator=( const shared_future& other ) noexcept; |
(C++17 起) | |
shared_future& operator=( shared_future&& other ) noexcept; |
(2) | (C++11 起) |
赋值另一个 shared_future
的内容。
1) 释放任何共享状态,并将 other 的内容赋值给 *this。赋值后,this->valid() == other.valid()。
2) 释放任何共享状态,并移动赋值 other 的内容给 *this。赋值后,other.valid() == false,且 this->valid() 将产生与赋值前 other.valid() 相同的值。
[编辑] 参数
其他 | - | 一个 std::shared_future ,它将状态转移到 *this |
[编辑] 返回值
*this