~/talk

Taming the Filter View in C++ Programming

slides:none on file

Filter view behaves oddly in practice: begin can be linear and reverse can make iteration quadratic, transform-before-filter can re-evaluate values, caching makes a const filter fail to compile and causes data-race/UB when concurrent threads call begin/empty, and modifying elements so they no longer satisfy the predicate is undefined behavior at runtime. Practical fixes: put filters early, build views ad hoc or use subrange/all_view, prefer empty over size checks, avoid modifying through a filter, and prefer one-pass (input-iterator) use or taking views by value for safety.

AI-written summary · about

  1. 0:00C++ filter view intro
  2. 1:10Basic filter view usage
  3. 3:04Composing views with pipes
  4. 5:37Range-based for with views
  5. 7:46Lazy evaluation in views
  6. 10:36Pull vs push model
  7. 13:48Performance impact of filter placement
  8. 15:19Containers vs views performance
  9. 18:55Cost of filter view ops
  10. 22:10Efficient iteration
  11. 26:47Reverse iteration
  12. 29:19Caching in views
  13. 33:14Reading filtered elements
  14. 36:26Thread safety issues
  15. 41:34Modifying elements
  16. 45:33Undefined behavior
  17. 52:36Filter view limitations
  18. 57:10Design alternatives
  19. 1:00:10Q&A
~/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.