~/talk

How to rangify your code

Talkat Meeting C++ 2021 · 2021-11-10..11-12· [rust]
slides:none on file

Claim: refactor loop-heavy C++ into composable range pipelines that are easier to read and reason about. Demonstrates concrete rewrites: small idioms (max, sliding mean, range generator), a matrix subtract mean implemented with a flat span and cycle view, and a full Jefferson seat allocation for 3 parties and 7 seats using cartesian_product then sort/take/count. Uses both std::ranges and range-v3, shows the exact views/algorithms used, and produces working, testable code examples with Compiler Explorer links.

AI-written summary · about

  1. 0:00Introduction
  2. 1:08Learning Resources
  3. 3:22Ranges Libraries
  4. 5:04What are Ranges?
  5. 8:53Simple Range Example
  6. 12:11Sliding Mean Example
  7. 16:34Matrix Manipulation
  8. 21:45Range Function Example
  9. 25:40Jefferson Method Algorithm
  10. 33:31Implementing complex algorithm
  11. 40:17Modernizing Algorithm Code
  12. 51:55Conclusion
~/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.