Range-based text formatting
summary
Range-based formatting uses range-v3 style pipelines and a homegrown ranges library (on GitHub under Boost license with 1 million lines of production use) to build lazy concat/formatter expression trees that expose size up front, supply a custom internal iteration entry (function-call operator), and provide appender sinks with a chunk-based reserve hook. Benchmarks show iterator-based concat hits ~50% overhead, internal-iteration cuts that to ~15% above handwritten code, and a custom appender saves ~20% versus std::push_back, yielding performance competitive with hand-tuned formatting.
AI-written summary · about
chapters (20)
- 0:00Intro
- 1:07Syntax Options
- 2:04Format Strings: Cons
- 5:36Format Strings: 18N
- 10:55Introduction to Ranges
- 11:57Essence of Ranges
- 14:21Ranges for Text 101: Replace basic string Member Functions by Range Algorithms
- 15:49Ranges for Text Formatting (1)
- 17:41Formatting into Containers (3)
- 22:26Avoid Heap Allocation For Components
- 24:41Fast Formatting into Containers
- 28:20Better reserve
- 29:00Iterators Cost Performance
- 30:54External iteration (2)
- 33:10Extend Range Concept to Internal Iteration
- 35:42Appender Customization Point
- 38:59Performance: Appender vs Hand-Written
- 42:14Performance: Custom vs Standard Appender
- 44:40Performance: Future Work
- 46:46Conclusion
related talks
54mHow to rangify your code
58mFrom Iterators to Ranges: The Upcoming Evolution Of the STL
42mAwaiting for the ranges: C++17
01h 02mC++20 - My Favorite Code Examples
01h 23mC++23 Standard Library Preview
01h 01mDocumentation in the Era of Concepts and Ranges
31mBenchmarking and Optimization of Rust Libraries
01h 00mC++23 Standard Library Preview
