std::experimental::packaged_task (concurrency TS)
From cppreference.com
< cpp | experimental | concurrency
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Experimental
Filesystem library (filesystem TS)
Library fundamentals (library fundamentals TS)
Library fundamentals 2 (library fundamentals TS v2)
Library fundamentals 3 (library fundamentals TS v3)
Extensions for parallelism (parallelism TS)
Extensions for parallelism 2 (parallelism TS v2)
Extensions for concurrency (concurrency TS)
Extensions for concurrency 2 (concurrency TS v2)
Concepts (concepts TS)
Ranges (ranges TS)
Reflection (reflection TS)
Mathematical special functions (special functions TR)
Extensions for concurrency
std::future extensions
Latches and barriers
Atomic smart pointers
This page is about the modified version of std::packaged_task provided by the concurrency TS supporting the std::future
improvements made by that TS. For the version of packaged_task
with type-erased allocator support provided by the Library Fundamentals TSes, see std::experimental::fundamentals_v2::packaged_task.
Defined in header
<experimental/future>
template< class > class packaged_task; //not defined
(1)
(concurrency TS)
template< class R, class ...Args >
class packaged_task<R(Args...)>;
(2)
(concurrency TS)
class packaged_task<R(Args...)>;
std::experimental::concurrency_v1::packaged_task
is a modified version of std::packaged_task provided by the concurrency TS that works with std::experimental::future.
The only change from std::packaged_task is that the get_future()
member function returns a std::experimental::future <R>.