Construct a std::experimental::future object from a std::experimental::future that holds a nested
std::experimental::future in its shared state.
The new future becomes ready when either
std::experimental::future supplied to this
constructor becomes ready, and a call to f.valid()
on the stored std::experimental::future object returns false, or
std::experimental::future supplied to this
constructor becomes ready, a call to f.valid()
on the stored std::experimental::future object returns true, and that nested std::experimental::future itself becomes ready.
In the former case, the newly-constructed future becomes ready
with a stored exception of type std::future_error,
with an error code of std::future_errc::broken_promise.
In the latter case, the newly-constructed future becomes ready with the stored value or exception from the nested future.
future(future<future<ResultType>>&& other);
Constructs a new std::experimental::future instance that unwraps
the nested std::experimental::future from other, such that *this
is ready when both other
and other.get()
would be ready, or other
is ready with a future for which valid()
returns false.
other has no associated
asynchronous result. this->valid() returns the same value that
other.valid()
returned before the invocation of this constructor. other.valid()
returns false.
std::bad_alloc if memory for the new
asynchronous state could not be allocated.
#include <experimental/future>