std::shared_future<T>::shared_future

来自cppreference.com
 
 
并发支持库
线程
(C++11)
(C++20)
(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++11)
信号量
闩与屏障
(C++20)
(C++20)
未来体
(C++11)
(C++11)
(C++11)
(C++11)
安全回收
(C++26)
(C++26)
风险指针





原子类型
(C++11)
(C++20)
原子类型的初始化
(C++11)(C++20 中弃用)
(C++11)(C++20 中弃用)
内存定序
原子操作的自由函数
原子标志的自由函数
 
 
shared_future() noexcept;
(1) (C++11 起)
(2)
shared_future( const shared_future& other );
(C++11 起)
(C++17 前)
shared_future( const shared_future& other ) noexcept;
(C++17 起)
shared_future( std::future<T>&& other ) noexcept;
(3) (C++11 起)
shared_future( shared_future&& other ) noexcept;
(4) (C++11 起)

构造新的 shared_future

1) 默认构造函数。构造空的共享未来体,它不指代共享状态,即 valid() == false
2) 构造与 other 指代同一共享状态(如果有)的共享未来体。
3,4) 转移 other 所保有的共享状态给 *this。构造后,other.valid() == falsethis->valid() 返回与 other.valid() 在构造前会返回者相同的值。

参数

other - 用以初始化的另一未来体对象