Ranges++: Are Output Range Adaptors the Next Iteration of C++ Ranges?
Talkat CppCon 2024 · on Friday, 2024-09-20· at 13:30· Adams A, 6700 North Gaylord Rockies Boulevard·
summary
Claims that output-range (push) adaptors eliminate the double-invocation TASI by merging increment+dereference into a single push_value customization point, with a working prototype called Daisy chains (~70 lines, godbolt link provided) that reproduces behavior but reduces extra calls (example: transform invoked 5 times instead of 7). The prototype implements right-associative composition, a stop signal for take_while via a push_result, and works for most adapters but fails or becomes awkward for multipass ops like reverse or sort and makes type propagation harder.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 3:39Problem with TASI in ranges
- 8:41Analyzing transform and filter views
- 22:42Filter view calls transform twice
- 29:56Eager evaluation in operator++
- 35:18Push versus pull programming
- 41:41Implementing push-style pipeline
- 50:15Operator composition with mixins
- 54:30Verifying solution with benchmarks
- 57:22Limitations of push-style models
- 1:00:32Future of output range adaptors
- 1:01:58Q&A
related talks
06mLightning Talk: Unlocking More Ways To Use Range-Based For
01h 04mC++ Concepts
01h 02mDiscovering a User-Facing Concept
01h 02mUniversal/Forwarding References
59mCute C++ Tricks, Part 2.5 of N - Code You Should Learn From & Never Write
01h 01mUsing the filter view in practice
01h 02mDiscovering a User-Facing Concept
05mLightning Talks: -std=c++20 -- Will This C++ Code Compile?
