If the associated state contains a deferred function from a call to
std::experimental::async
then invoke that function
and return the result, otherwise wait until the asynchronous result associated
with an instance of std::experimental::future
is ready, and then return
the stored value or throw the stored exception.
void future<void>::get(); R& future<R&>::get(); R future<R>::get();
this->valid()
would return true
.
If the state associated with *this
contains a deferred function,
invoke the deferred function and return the result or propagate
any thrown exception.
Otherwise, block until the asynchronous result associated with
*this
is ready. If the result is a stored exception
then throw that exception. Otherwise return the stored value.
If the associated state contains a deferred function then the result
of the function invocation. Otherwise, if ResultType
is void
then return
normally. If ResultType
is R&
for some type R
then return the stored reference. Otherwise, return the stored
value.
The exception thrown by the deferred exception, or stored in the asynchronous result, if any.
this->valid()==false
#include <experimental/future>