Better C++ ranges
summary
think-cell ships a C++ ranges library evolved over 20 years that stays compatible with C++20 but replaces fat iterators with an index abstraction so stacked adaptors stay tiny and efficient, lets adaptors hold data to be self-contained, adds internal iteration so generators and formatters run like handwritten loops, and custom return traits that remove end checks. Measured results show iterator-based code wastes 50% extra cost while internal-iteration paths hit about 15% overhead, used successfully for lazy text formatting and an HTTP server.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 1:06Why use ranges
- 4:35Sorting and erasing
- 6:01Basics of ranges
- 7:06Transform and filter
- 12:46Iterator size growth
- 17:01Index-based ranges
- 23:25Singleton results
- 26:13Visitor patterns to ranges
- 31:31Internal vs external
- 38:53Unifying ranges with formatting
- 45:18Formatting containers
- 51:41String construction perf
- 56:39Conclusion
- 57:24Q&A
related talks
01h 04mEffective Ranges: A Tutorial for Using C++2x Ranges
01h 06mConquering C++20 Ranges
01h 00mMissing (and future?) C++ range concepts
01h 04mRange adaptors - 5 years after C++20
40mRanges and Iterators for Numerical Problems
01h 01mIteration Revisited: A Safer Iteration Model for Cpp
01h 00mBack to Basics: (Range) Algorithms in C++
55mC++ Cache Friendly Data + Functional + Ranges = ❤️
