From cppreference.com
voidoperator()(Args...args);(since C++11)Calls the stored task as if by
(f,args...), where f is the stored task. The return value of the task or any exceptions thrown are stored in the shared state. The shared state is made ready and any threads waiting for this are unblocked.
Parameters
args - the parameters to pass on invocation of the stored task Return value
(none)
Exceptions
on the following error conditions:
The stored task has already been invoked. The error category is set to
.
*this has no shared state. The error category is set to
.
Example
Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior
C++11 a successful call to operator() synchronized with
a call to any member function of a
or
that share their shared state with *thisno additional synchronization
guarantees other than what is
already provided by shared state See also