Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

async_result

An interface for customising the behaviour of an initiating function.

template<
    typename CompletionToken,
    typename... Signatures>
class async_result
Types

Name

Description

completion_handler_type

(Legacy.) The concrete completion handler type for the specific signature.

return_type

(Legacy.) The return type of the initiating function.

Member Functions

Name

Description

async_result [constructor]

(Legacy.) Construct an async result from a given handler.

get

(Legacy.) Obtain the value to be returned from the initiating function.

initiate [static]

Initiate the asynchronous operation that will produce the result, and obtain the value to be returned from the initiating function.

The async_result trait is a customisation point that is used within the initiating function for an asynchronous operation. The trait combines:

Specialisations of the trait must satisfy the async_result_requirements, and are reponsible for determining:

This template may be specialised for user-defined completion token types. The primary template assumes that the CompletionToken is the already a concrete completion handler.

Remarks

For backwards compatibility, the primary template implements member types and functions that are associated with legacy forms of the async_result trait. These are annotated as "Legacy" in the documentation below. User specialisations of this trait do not need to implement these in order to satisfy the async_result_requirements.

In general, implementers of asynchronous operations should use the async_initiate function rather than using the async_result trait directly.

Requirements

Header: boost/asio/async_result.hpp

Convenience header: boost/asio.hpp


PrevUpHomeNext