Documentation Home >> Headers >> <future> Header >> std::promise >> std::promise::get_future Member function

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

std::future<ResultType> get_future();

Preconditions:

*this has an associated asynchronous result.

Returns:

A std::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::future has already been obtained for this asynchronous result through a prior call to get_future().

Header

#include <future>

See Also