std::shared_future<T>::shared_future
来自cppreference.com
< cpp | thread | shared future
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() == false 且 this->valid() 返回与 other.valid() 在构造前会返回者相同的值。
参数
other | - | 用以初始化的另一未来体对象 |