Skip to content

Commit

Permalink
Change async_compose example to use return type compatible with new a…
Browse files Browse the repository at this point in the history
…sync_result form.
  • Loading branch information
chriskohlhoff committed Jul 31, 2022
1 parent 10251c3 commit 879dab6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions asio/include/asio/compose.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,11 @@ struct associator<Associator,
* auto async_echo(tcp::socket& socket,
* asio::mutable_buffer buffer,
* CompletionToken&& token) ->
* typename asio::async_result<
* typename std::decay<CompletionToken>::type,
* void(asio::error_code, std::size_t)>::return_type
* decltype(
* asio::async_compose<CompletionToken,
* void(asio::error_code, std::size_t)>(
* std::declval<async_echo_implementation>(),
* token, socket))
* {
* return asio::async_compose<CompletionToken,
* void(asio::error_code, std::size_t)>(
Expand Down
8 changes: 5 additions & 3 deletions asio/src/doc/reference.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -3321,9 +3321,11 @@ The async\_compose function simplifies the implementation of composed asynchrono
auto async_echo(tcp::socket& socket,
asio::mutable_buffer buffer,
CompletionToken&& token) ->
typename asio::async_result<
typename std::decay<CompletionToken>::type,
void(asio::error_code, std::size_t)>::return_type
decltype(
asio::async_compose<CompletionToken,
void(asio::error_code, std::size_t)>(
std::declval<async_echo_implementation>(),
token, socket))
{
return asio::async_compose<CompletionToken,
void(asio::error_code, std::size_t)>(
Expand Down

0 comments on commit 879dab6

Please sign in to comment.