Documentation Home >> Headers >> <future> Header >> std::future >> std::future<>::wait Member function

If the state associated with *this contains a deferred function, invoke the deferred function. Otherwise, wait until the asynchronous result associated with an instance of std::future is ready.

void wait();

Preconditions:

this->valid() would return true.

Effects:

If the associated state contains a deferred function invoke the deferred function and stores the returned value or thrown exception as the asynchronous result. Otherwise, block until the asynchronous result associated with *this is ready.

Throws:

Nothing.

Header

#include <future>

See Also