Documentation Home >> Headers >> <jss/experimental_future.hpp> Header >> std::experimental::packaged_task >> std::experimental::packaged_task::get_future Member function

Retrieve a std::experimental::future instance for the asynchronous result associated with *this.

std::experimental::future<ResultType> get_future();

Preconditions:

*this has an associated asynchronous result.

Returns:

A std::experimental::future instance for the asynchronous result associated with *this.

Throws:

An exception of type std::future_error with an error code of std::future_errc::future_already_retrieved if a std::experimental::future has already been obtained for this asynchronous result through a prior call to get_future().

Header

#include <experimental/future>

See Also