std::future<T>::share
提供: cppreference.com
std::shared_future<T> share()noexcept; | ||
*this の共有状態 (もしあれば) を std::shared_future オブジェクトに転送します。 複数の std::shared_future で同じ共有状態を参照できます。 これは std::future では不可能なことです。
std::future の share
を呼び出した後、 valid()==false になります。
目次 |
[編集]引数
(なし)
[編集]戻り値
std::shared_future<T>(std:move(*this)) によって行われたかのように構築された、 *this がそれまで保持していた共有状態 (もしあれば) を持つ std::shared_future オブジェクト。
[編集]例
This section is incomplete Reason: no example |
[編集] 欠陥報告
以下の動作変更欠陥報告は以前に発行された C++ 標準に遡って適用されました。
DR | 適用先 | 発行時の動作 | 正しい動作 |
---|---|---|---|
LWG 2556 | C++11 | share() requires valid() to be true | requirement removed and made noexcept |
[編集]関連項目
(C++11) | (他のフューチャーからも参照される可能性がある) 非同期に設定される値を待ちます (クラステンプレート) |