~/lightning

Lightning Talk: operator for - C++ Generator Ranges Without Coroutine Overhead

Lightningat C++Now 2023 · 2023-05-07..05-12· [c-and-cpp]
links:none on file
slides:none on file

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

~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.