std::packaged_task<R(Args...)>::make_ready_at_thread_exit (3) - Linux Manuals
std::packaged_task<R(Args...)>::make_ready_at_thread_exit: std::packaged_task<R(Args...)>::make_ready_at_thread_exit
NAME
std::packaged_task<R(Args...)>::make_ready_at_thread_exit - std::packaged_task<R(Args...)>::make_ready_at_thread_exit
Synopsis
void make_ready_at_thread_exit( ArgTypes... args ); (since C++11)
Calls the stored task with forwarded args as the arguments. The return value of the task or any exception thrown by it is stored in the shared state of *this.
The shared state is only made ready after the current thread exits and all objects of thread local storage duration are destroyed.
Parameters
args - the parameters to pass on invocation of the stored task
Return value
(none)
Exceptions
std::future_error on the following error conditions:
* The stored task has already been invoked. The error category is set to promise_already_satisfied.
* *this has no shared state. The error category is set to no_state.
Example
// Run this code
Output:
See also
operator() (public member function)