| 91 | //------------------------------------------------------------------------------ |
| 92 | |
| 93 | void test_callback() |
| 94 | { |
| 95 | boost::asio::io_context io_context; |
| 96 | |
| 97 | // Test our asynchronous operation using a lambda as a callback. We will use |
| 98 | // an io_context to specify an associated executor. |
| 99 | async_read_input("Enter your name", |
| 100 | boost::asio::bind_executor(io_context, |
| 101 | [](const std::string& result) |
| 102 | { |
| 103 | std::cout << "Hello " << result << "\n"; |
| 104 | })); |
| 105 | |
| 106 | io_context.run(); |
| 107 | } |
| 108 | |
| 109 | //------------------------------------------------------------------------------ |
| 110 |
no test coverage detected