~/talk

Using the filter view in practice

Talkat Meeting C++ 2023 · 2023-11-12..11-14· [typescript]
slides:none on file

The C++20 filter view works by wrapping a range and evaluating the predicate on iteration so the very first call to begin can be linear and implementations often use begin caching to make subsequent begins cheap. That caching plus inconsistent const propagation (ref vs owning view for temporaries) and non‑atomic begin modifications yield real surprises: undefined behavior when predicate breaks (mutating an element so it no longer matches), surprising compile errors for const, and thread‑unsafe runtime bugs. Concrete fixes: avoid const iteration, avoid concurrent begins, or copy into an owning view.

AI-written summary · about

  1. 0:00C++20 views introduction
  2. 1:06Filter view basics
  3. 6:04How views work
  4. 17:05Performance of filter views
  5. 28:32Constraints and caching
  6. 37:10Const breaks filter views
  7. 44:46Pitfalls with filter views
  8. 51:22Concurrency issues
  9. 56:43Best practices
  10. 59:57Conclusion
~/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.