The type of the function's return value is determined by the [@boost:/doc/html/boost_asio/reference/async_result.html `net::async_result`] customization point, which comes with specializations for common library types such as `std::future` and may also be specialized for user-defined types. The body of the initiating function calls the [@boost:/doc/html/boost_asio/reference/async_initiate.html `net::async_initiate`] helper to capture the arguments and forward them to the specialization of `async_result`. An additional "initiation function" object is provided which `async_result` may use to immediately launch the operation, or defer the launch of the operation until some point in the future (this is called "lazy execution"). The initiation function object receives the internal completion handler which matches the signature expected by the initiating function:
The type of the function's return value is determined by the [@boost:/doc/html/boost_asio/reference/async_result.html `net::async_result`] customization point, which comes with specializations for common library types such as `std::future` and may also be specialized for user-defined types. The body of the initiating function calls the [@boost:/doc/html/boost_asio/reference/async_initiate.html `net::async_initiate`] helper to capture the arguments and forward them to the specialization of `async_result`. An additional "initiation function" object is provided which `async_result` may use to immediately launch the operation, or defer the launch of the operation until some point in the future (this is called "lazy execution"). The initiation function object receives the internal completion handler which matches the signature expected by the initiating function: