~/talk

Advanced Ranges: Writing Modular, Clean, and Efficient Code with Custom Views

Talkat CppNorth 2025 · 2025-07-21..07-23· [software-architecture]
links:none on file
slides:none on file

Shows how custom C++20/23 views cut allocations and copies and can be plugged into pipelines using the range adapter closure (C++23) pattern. Demonstrates a sliding window median implemented with a deque and a stack-allocated circular array that avoids per-window heap allocations and yields up to >10x speedup for 30k elements versus the standard slide-based view. Covers iterator trait correctness, when to use value vs reference semantics, how laziness affects determinism, and practical gotchas that broke composition until fixed.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 1:16Ranges overview and benefits
  3. 3:43Views, lazy evaluation and examples
  4. 8:18Composability with ranges
  5. 10:44Lazy vs eager evaluation
  6. 14:57Why build custom views
  7. 16:20Sliding window median problem
  8. 20:31Skip every n element demo
  9. 22:37Custom view boilerplate
  10. 28:54Sentinels and iterator design
  11. 30:40Range adapter closure
  12. 33:08Composition pitfalls
  13. 33:48Performance optimizations
  14. 36:35Circular array implementation
  15. 39:03Managing external state
  16. 43:34Custom view for state
  17. 46:46When to use custom views
  18. 47:51Performance optimization results
  19. 48:12Iterator traits and requirements
  20. 49:17External state by reference
  21. 50:19Best practices and pitfalls
  22. 51:21Gotchas and debugging tips
  23. 51:52Q&A and closing
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.