Coroutines with Boost.Cobalt
The previous chapters introduced C++20 coroutines and the Boost.Asio library, which is the foundation for writing asynchronous input/output (I/O) operations using Boost. In this chapter, we will explore Boost.Cobalt, a high-level abstraction based on Boost.Asio that simplifies asynchronous programming with coroutines.
Boost.Cobalt allows you to write clear, maintainable asynchronous code while avoiding the complexities of manually implementing coroutines in C++ (as covered in Chapter 8). Boost.Cobalt is fully compatible with Boost.Asio, allowing you to seamlessly combine both libraries in your projects. By using Boost.Cobalt, you can focus on building your application without worrying about the low-level details of coroutines.
In this chapter, we will cover the following Boost.Cobalt topics:
- Introducing the Boost.Cobalt library
- Boost.Cobalt generators
- Boost.Cobalt tasks and promises
- Boost.Cobalt channels
- Boost.Cobalt synchronization...