std::packaged_task - cppreference.com
en.cppreference.com › w › cppOct 19, 2021 · std:: packaged_task. 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.
async - C++ Reference - cplusplus.com
https://www.cplusplus.com/reference/future/asyncpolicy description; launch::async: Asynchronous: Launches a new thread to call fn (as if a thread object is constructed with fn and args as arguments, and accessing the shared state of the returned future joins it). launch::deferred: Deferred: The call to fn is deferred until the shared state of the returned future is accessed (with wait or get).At that point, fn is called and the function is ...