| 28 | } |
| 29 | |
| 30 | cobalt::task<void> work(int min_a, int max_a, int b) |
| 31 | { |
| 32 | auto exec = co_await cobalt::this_coro::executor; |
| 33 | for (int a = min_a; a <= max_a; a++) |
| 34 | { |
| 35 | // the following two calls offload the work to another thread. |
| 36 | int c = co_await cpu_intense_work(a, b, boost::asio::executor_arg, exec); |
| 37 | printf("The CPU intensive result of adding %d to %d, is %d\n", a, b, c); |
| 38 | } |
| 39 | } |
| 40 | int main(int , char * []) |
| 41 | { |
| 42 | const std::size_t n = 4u; |
no test coverage detected