命名空间
变体
操作

std::shared_future<T>::operator=

来自 cppreference.cn
 
 
并发支持库
线程
(C++11)
(C++20)
this_thread 命名空间
(C++11)
(C++11)
(C++11)
协作式取消
互斥
(C++11)
通用锁管理
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
条件变量
(C++11)
信号量
闩锁和屏障
(C++20)
(C++20)
期值
(C++11)
(C++11)
(C++11)
(C++11)
安全回收
(C++26)
Hazard Pointers
原子类型
(C++11)
(C++20)
原子类型的初始化
(C++11)(C++20 中已弃用)
(C++11)(C++20 中已弃用)
内存顺序
(C++11)(C++26 中已弃用)
用于原子操作的自由函数
用于原子标志的自由函数
 
 
(1)
shared_future& operator=( const shared_future& other );
(since C++11)
(until C++17)
shared_future& operator=( const shared_future& other ) noexcept;
(since C++17)
shared_future& operator=( shared_future&& other ) noexcept;
(2) (since C++11)

将另一个 shared_future 的内容赋值给此对象。

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

[edit] 参数

other - 一个 std::shared_future,它将状态转移到 *this

[edit] 返回值

*this