hpx::packaged_task

hpx::packaged_task#

Defined in header hpx/future.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

template<typename Sig>
class packaged_task#

The class template hpx::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 hpx::future objects. Just like hpx::function, hpx::packaged_task is a polymorphic, allocator-aware container: the stored callable target may be allocated on heap or with a provided allocator.