Documentation Home >> Headers >> <future> Header >> std::atomic_future >> std::atomic_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::atomic_future is ready.

void wait() const;


this->valid() would return true.


Calls to get() and wait() from multiple threads on std::atomic_future instances that share the same associated state are serialized. If the associated state contains a deferred function then the first call to get() or wait() invokes the deferred function and stores the returned value or thrown exception as the asynchronous result.

Block until the asynchronous result associated with *this is ready.




#include <future>

See Also