Generators, Coroutines and Other Brain Unrolling Sweetness
summary
C++20 coroutines produce lazy generators that let serial code yield values on demand; examples show an iota infinite generator, a spiral generator producing pixel coordinates, a hue-cycle generator, and a simple zip view that steps two generators in lockstep to draw colored pixels — the demos run with MSVC experimental support (non‑standard) and work but rely on an implementation library (cppcoro recommended). Warnings include dangling temporaries, “decapitation” when begin resumes execution, and no std::generator type yet.
AI-written summary · about
chapters (10)
- 0:00Intro
- 0:32FUNCTIONS & SUB-ROUTINES
- 7:32USER DEFINED ITERATORS
- 10:50AWKWARD COUPLING
- 17:54LOGIC PUZZLE
- 22:22C++20 COROUTINES
- 25:03THE SIMPLEST CODE
- 42:10DANGLING REFERENCES
- 46:43DECAPITATION
- 55:10RESOURCES
related talks
31mGenerators, Coroutines and Other Brain Unrolling Sweetness
48m“Coroutines: what can't they do?”
01h 35mNo Compiler Required - Hand-Rolling C++20 Coroutines in C++17
57mC++ Coroutines: Under the covers
01h 20mCoroutines for Dummies
01h 01mWhat We’ve Been Awaiting For? - How to Build a C++ Coroutine Type
38mWhat's New In C++23
54mExploring Source Generators
