Class to enable lazy construction of a packaged_task from a completion token.
template< typename Function, typename Allocator = std::allocator<void>> class packaged_token
Name |
Description |
---|---|
The allocator type. The allocator is used when constructing the std::promise object for a given asynchronous operation. |
Name |
Description |
---|---|
Obtain allocator. |
|
Construct using specified allocator. |
The packaged_token
class is used to adapt a function object as a packaged task. When this adapter
is passed as a completion token to an asynchronous operation, the result
of the function object is retuned via a std::future.
Use the package
function rather than using this class directly.
Header: asio/package.hpp
Convenience header: None