Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This version of Boost is under active development. You are currently in the develop branch. The current version is 1.89.0.
An interface for customising the behaviour of an initiating function.
template< typename CompletionToken, typename... Signatures> class async_result
|
Name |
Description |
|---|---|
|
(Legacy.) The concrete completion handler type for the specific signature. |
|
|
(Legacy.) The return type of the initiating function. |
|
Name |
Description |
|---|---|
|
async_result [constructor] |
(Legacy.) Construct an async result from a given handler. |
|
(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.
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.
For a more detailed discussion of the role of async_result and async_initiate,
see the overview documentation for completion
token.
Header: boost/asio/async_result.hpp
Convenience header: boost/asio.hpp