◐ Shell
clean mode source ↗

std::shared_future<T>::shared_future - cppreference.com

提供: cppreference.com

<tbody> </tbody> <tbody class="t-dcl-rev t-dcl-rev-num "> </tbody><tbody> </tbody>

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 - 初期化するための別のフューチャーオブジェクト