C++23: using std::generator in practice
summary
Explains that C++23 adds std::generator as the first standard coroutine interface, shows live code (generator-as-a-view, begin/++/ semantics), and builds working examples: Fibonacci generator, a concurrent-queue reader, and a range-based pipeline. Covers concrete pitfalls: don’t pass parameters by reference*, generators are non‑copyable non‑const, state defaults to heap allocation (PMR option shown), exceptions propagate via begin/++. Includes slides and practical code, not just theory.
AI-written summary · about
chapters (10)
- 0:00C++23 and std::generator intro
- 1:04What are coroutines and why they matter
- 10:25Function to coroutine conversion
- 16:27How std::generator works
- 28:11Fibonacci with std::generator
- 33:55Coroutines vs manual state
- 39:23Concurrent data processing
- 45:02Caveats with std::generator
- 53:17Advanced std::generator features
- 57:14Summary and coroutines future
related talks
56mWhat’s New in C++23
01h 02mC++20’s Coroutines for Beginners
01h 03mHow C++20 changes the way we write code
58mAn Introduction to C++ Coroutines
57m[filtered] Asynchronous C++ Programming
01h 02mC++20 - My Favorite Code Examples
55mC++20 coroutines as an API principle
01h 00mC++23: An Overview of Almost All New and Updated Features
