Documentation Home >> Headers >> <jss/experimental_future.hpp> Header >> std::experimental::future >> std::experimental::future Unwrapping Constructor

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

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);

Effects:

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.

Postconditions:

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.

Throws:

std::bad_alloc if memory for the new asynchronous state could not be allocated.

Header

#include <experimental/future>

See Also