Summary
In this chapter, we saw how to implement coroutines using the Boost.Cobalt library. It was added to Boost only recently, and there is not much information about it. It simplifies the development of asynchronous code with coroutines, avoiding writing the low-level code necessary for C++20 coroutines.
We studied the main library concepts and developed some simple examples to understand them.
With Boost.Cobalt, writing asynchronous code using coroutines is simplified. All the low-level details of writing coroutines in C++ are implemented by the library and we can focus just on the functionality we want to implement in our programs.
In the next chapter, we will see how to debug asynchronous code.