~/talk

C++ Standard Views

Talkat ACCU 2023 · 2023-04-19..04-22· [c-and-cpp]
slides:none on file

C++20/23 ranges views come with concrete pitfalls: some views cache begin which makes repeat iteration cheap but causes surprising const and lifetime errors, filter can produce undefined behavior when an element is modified to fail its predicate, and const propagation differs between lvalue and rvalue ranges. Practical fixes shown: use std::ranges::subrange, forwarding references, take-by-value for views, or copy views; a small prototype "Bell views" implements always-propagate const and avoids caching to restore predictable semantics.

AI-written summary · about

  1. 0:00C++20 views intro
  2. 7:57How views work internally
  3. 14:02API: views vs containers
  4. 27:31Performance of view ops
  5. 38:49Pipe drop compile fail
  6. 51:27Undefined behavior with filter
  7. 1:01:21Modifying via zip views
  8. 1:15:37Broken principles in views
  9. 1:23:26Bell views proposal
  10. 1:34:13Final advice on views
~/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.