| 192 | |
| 193 | template <typename CompletionToken> |
| 194 | decltype(auto) async_error_code(CompletionToken&& token) |
| 195 | { |
| 196 | using signature_type = void(error_code); |
| 197 | return asio_impl::async_initiate<CompletionToken, signature_type>( |
| 198 | [](auto&& h) |
| 199 | { |
| 200 | std::invoke(std::forward<decltype(h)>(h), |
| 201 | error_code(make_error_code(std::errc::not_enough_memory))); |
| 202 | }, |
| 203 | token); |
| 204 | } |
| 205 | |
| 206 | TEST_CASE("Error codes native to the version of Asio used are transformed " |
| 207 | "into a system_error", |