Store an exception in the asynchronous result associated with *this
.
void set_exception(std::exception_ptr e);
*this
has an associated asynchronous result. (bool)e
is true
.
Store e
in the
asynchronous result associated with *this
.
The asynchronous result associated with *this
is ready
with a stored exception. Any threads blocked waiting for the asynchronous
result are unblocked.
An exception of type std::future_error
with an error code of std::future_errc::promise_already_satisfied
if the asynchronous result already has a stored value or exception.
Multiple concurrent calls to set_value()
and set_exception()
are serialized. A successful call to set_exception()
happens-before a call to std::experimental::future<ResultType>::get()
or std::experimental::shared_future<ResultType>::get()
which retrieves the exception
stored.
#include <experimental/future>