| 169 | //------------------------------------------------------------------------------ |
| 170 | |
| 171 | void test_callback() |
| 172 | { |
| 173 | boost::asio::io_context io_context; |
| 174 | |
| 175 | // Test our asynchronous operation using a lambda as a callback. We will use |
| 176 | // an io_context to obtain an associated executor. |
| 177 | async_read_input("Enter your name", |
| 178 | boost::asio::bind_executor(io_context, |
| 179 | [](const std::string& result) |
| 180 | { |
| 181 | std::cout << "Hello " << result << "\n"; |
| 182 | })); |
| 183 | |
| 184 | io_context.run(); |
| 185 | } |
| 186 | |
| 187 | //------------------------------------------------------------------------------ |
| 188 |
no test coverage detected