| 18 | |
| 19 | template <typename Callback> |
| 20 | void read_input(const std::string& prompt, Callback cb) |
| 21 | { |
| 22 | std::thread( |
| 23 | [prompt, cb = std::move(cb)]() mutable |
| 24 | { |
| 25 | std::cout << prompt << ": "; |
| 26 | std::cout.flush(); |
| 27 | std::string line; |
| 28 | std::getline(std::cin, line); |
| 29 | std::move(cb)(std::move(line)); |
| 30 | }).detach(); |
| 31 | } |
| 32 | |
| 33 | //------------------------------------------------------------------------------ |
| 34 |
no test coverage detected