|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
| Getting the result | ||||
promise::get_future | ||||
| Setting the result | ||||
| Non-member Functions | ||||
| Helper Classes | ||||
std::future<R> get_future(); | (since C++11) | |
Returns a future object associated with the same shared state as*this.
An exception is thrown if*this has no shared state orget_future has already been called. To get multiple "pop" ends of the promise-future communication channel, usestd::future::share.
Calls to this function do not introduce data races with calls toset_value,set_exception,set_value_at_thread_exit, orset_exception_at_thread_exit (therefore they need not synchronize with each other).
(none)
A future referring to the shared state of*this.
std::future_error on the following conditions:
get_future() has already been called on a promise with the same shared state as*this. The error code is set tofuture_already_retrieved.