El 01/02/2026 a las 23:56, Joaquín M López Muñoz via Boost escribió:
No dia 1 de fev. de 2026, às 21:47, Vinnie Falco via Boost <boost@lists.boost.org> escreveu:
I've been working on a family of libraries which are based on C++ 20 coroutines. I realize, that a lot of folks may not be familiar with this language feature as it is relatively new and the standard library also did not ship with the components needed to make use of the feature without additional third party libraries. I have worked up a tutorial to teach how to use coroutines. I hope someone finds this valuable.
Interesting material! Thanks for sharing.
For me, many coroutine tutorials were confusing because my engineer mind was always trying to match the "strange" coroutine control flow, return types, yields, co_return and stuff with the classic C++ control flow and return types. I could not understand how a coroutine, from a caller point of view, was a normal C++ function (no need to declare something as a coroutine, it's an implementation detail), when the declared return type of a coroutine was really obtained from the caller, how could you obtain access to the opaque handler, etc. So I generated some AI-generated tutorial (without much effort, please don't take as a "definitive" tutorial) focused on how the compiler implements coroutines, coroutine frames, filled with pseudo-code that shows which transformations are needed. In case it helps here it is: "C++ Coroutines: Complete Implementation Guide, What the Compiler Really Does" https://gist.github.com/igaztanaga/906b47b7fe54603821ec1200d5f7176f It contains some errors or incomplete examples, I hope it's helpful for people approaching coroutines from the classic C++ object model and flow control... Best, Ion