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.90.0.
Class used to specify that an asynchronous operation should return a function object to lazily launch the operation.
class deferred_t
|
Name |
Description |
|---|---|
|
Type alias to adapt an I/O object to use deferred_t as its default completion token type. |
|
|
Adapts an executor to add the deferred_t completion token as the default. |
|
Name |
Description |
|---|---|
|
as_default_on [static] |
Function helper to adapt an I/O object to use deferred_t as its default completion token type. |
|
deferred_t [constructor] |
Default constructor. |
|
Creates a new deferred from a function. |
|
|
values [static] |
Returns a deferred operation that returns the provided values. |
|
when [static] |
Creates a conditional object for branching deferred operations. |
The deferred_t
class is used to indicate that an asynchronous operation should return a
function object which is itself an initiation function. A deferred_t object may be passed
as a completion token to an asynchronous operation, typically as the default
completion token:
auto my_deferred_op = my_socket.async_read_some(my_buffer);
or by explicitly passing the special value boost::asio::deferred:
auto my_deferred_op = my_socket.async_read_some(my_buffer, boost::asio::deferred);
The initiating function (async_read_some in the above example) returns a function object that will lazily initiate the operation.
Header: boost/asio/deferred.hpp
Convenience header: boost/asio.hpp