📖 Book · cpp20 · advanced
✨ C++20 coroutines: a generator from scratch
co_yield, promise_type and coroutine_handle — build a lazy generator you can range-for over.
C++20 coroutines explained by building one: stackless cooperative suspension, the promise_type protocol, a complete runnable lazy Generator<T> driving Fibonacci, the heap frame + coroutine_handle model, and where coroutines beat threads.
4 chapters▶ runnable code✦ in-depth animation
▶ See it animated:C++20 Coroutines — co_yield, co_await, co_return →
What this book covers
- 01What a coroutine actually is
- 02A lazy generator — run it
- 03Suspend, resume & the frame
- 04Where coroutines shine
Read it in full — runnable C++ + step-through animations
Every chapter of C++20 coroutines: a generator from scratch ships complete, editable code you compile and run in the browser, plus the same in-depth animations as the lessons.