How to Rangify Your Code
summary
Shows how to replace loops with actual range tools: uses range-v3 and the standard library plus a company-implemented ranges::to to build containers, demonstrates a sliding-mean via the sliding view, subtracts column means using a flat span and cycle view, sums non-defectives with accumulate+filter+projections, and implements the Jefferson/Hunt seat allocation with cartesian_product and sort. Benchmarks with Google Benchmark (3 parties/7 seats, 15/700, 60/70,000) show negligible time difference between C++17 and ranges versions.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 0:30Recommended talks
- 2:31Libraries
- 4:25Rangifying
- 10:40Sliding mean
- 16:43Multiarray
- 23:56Filter
- 33:03Index Handling
- 40:28Complex Example
- 40:46Hunt Method
- 44:43Counting
- 46:38Nested Loop
- 50:28Sorting
- 53:46Countif
related talks
01h 15mHow to Rangify Your Code
01h 02mC++20 Ranges in Practice
57mRange Algorithms, Views and Actions: A Comprehensive Guide
01h 01mFrom STL to Ranges: Using Ranges Effectively
54mThrowing Tools at C++ Ranges
01h 06mC++20 Ranges in Practice
01h 34mAn Overview of Standard Ranges
01h 34mRanges for the Standard Library
