~/talk

How to Rangify Your Code

Talkat ACCU 2022 · 2022-04-06..04-09· [c-and-cpp]
slides:none on file

Shows how to refactor real C++ loops into concrete range pipelines using range-v3, the standard library ranges and helpers like ranges::to; demonstrates adapters: sliding, cycle, zip, enumerate, iota, span, transform, accumulate and cartesian_product to implement sliding means, flatten-and-transform matrix ops, indexed range generation, filtered accumulations and a full Jefferson (Huntington) seat-allocation pipeline. Benchmarks use google::benchmark on 3 inputs (3 parties/7 seats, 15/700, 60/7000) and show C++20-style code wins on medium+ inputs but ranges-v3 is the library used so results compare that implementation not the final standard.

AI-written summary · about

  1. 0:00Start
  2. 0:24What Qualifies Me To Give this Talk
  3. 2:09Overview of Standard Ranges
  4. 2:39Write Your Own Range Adapter
  5. 2:49Range Adapter
  6. 3:53Rangev3 Library
  7. 4:12Nanorange
  8. 4:58Ranges
  9. 14:18Sliding Mean
  10. 18:25Subtract a Mean from Matrix Elements
  11. 44:12The Enumerate View
  12. 46:22Disclaimer
  13. 47:59Complex Example
  14. 48:26Method of the Greatest Divisors
  15. 56:39For Loop
  16. 57:30Cartesian Product
  17. 1:01:36Sorting
  18. 1:06:58Calculate the Number of Seats
  19. 1:12:38Summary
~/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.