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