asio C++ library

PrevUpHomeNext

packaged_token

Class to enable lazy construction of a packaged_task from a completion token.

template<
    typename Function,
    typename Allocator = std::allocator<void>>
class packaged_token
Types

Name

Description

allocator_type

The allocator type. The allocator is used when constructing the std::promise object for a given asynchronous operation.

Member Functions

Name

Description

get_allocator

Obtain allocator.

packaged_token

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.

Requirements

Header: asio/package.hpp

Convenience header: None


PrevUpHomeNext