std::packaged_task (3) - Linux Manuals
std::packaged_task: std::packaged_task
NAME
std::packaged_task - std::packaged_task
Synopsis
Defined in header <future>
template< class > class packaged_task; //not defined (1) (since C++11)
template< class R, class ...Args > (2) (since C++11)
class packaged_task<R(Args...)>;
The class template std::packaged_task wraps any Callable target (function, lambda expression, bind expression, or another function object) so that it can be invoked asynchronously. Its return value or exception thrown is stored in a shared state which can be accessed through std::future objects.
Just like std::function, std::packaged_task is a polymorphic, allocator-aware container: the stored callable target may be allocated on heap or with a provided allocator. (until C++17)
Member functions
constructor (public member function)
destructor (public member function)
operator= (public member function)
valid (public member function)
swap (public member function)
Getting the result
get_future (public member function)
Execution
operator() (public member function)
make_ready_at_thread_exit (public member function)
reset (public member function)
Non-member functions
std::swap(std::packaged_task) specializes the std::swap algorithm