Lightning Talk: operator for - C++ Generator Ranges Without Coroutine Overhead
summary
Proposes operator for as a language-level transform that turns a body written like a coroutine into a lambda-taking function so ranges can use the fast callback pattern without coroutine overhead. Demonstrates concatenating three vectors of 30 elements (90 ints) and summing them; std::generator version suffers about 20× slowdown caused by heap allocation and state-machine overhead, while the callback approach inlines and avoids allocations. Shows how break maps to a boolean return and how the compiler emits the lambda and state handling automatically.
AI-written summary · about
related talks
01h 02mC++20 Ranges in Practice
01h 15mHow to Rangify Your Code
01h 06mC++20 Ranges in Practice
01h 09mMissing (and future?) C++ Range Concepts
01h 01mFrom STL to Ranges: Using Ranges Effectively
57mRange Algorithms, Views and Actions: A Comprehensive Guide
01h 04mHow to Rangify Your Code
01h 13mFrom Iterators to Ranges — the Upcoming Evolution of the Standard Library
