~/talk

Implementing Ranges and Views

Talkat Core C++ 2024 · 2024-11-26..11-28· [c-and-cpp]
links:none on file
slides:none on file

Explains how to implement new C++20/23 views by showing a working range adapter closure plus a CRTP-backed view that holds its input to avoid dangling iterators (naive subrange return causes UB), uses view_interface, deduction guides and views::all to choose owning vs ref views, and implements iterator behaviors (operator*, ++, sentinel comparisons) so filters, transforms and lazy set operations are single-pass. Case study builds lazy sorted-range adapters (merge, set_union/intersection) and shows std::generator as a simpler input-only alternative; implementations work but require careful lifetime and category handling.

AI-written summary · about

  1. 0:00Introduction to ranges
  2. 1:44Terminology and foundations
  3. 5:02Views and range adaptors
  4. 9:06Composability examples
  5. 13:39Standard library views
  6. 18:22Writing custom adapters
  7. 26:56First adapter implementation
  8. 34:07Lifetime management and views::all
  9. 39:39Iterators and laziness
  10. 43:41Range categories and refinements
  11. 47:06Const-correctness and CPOs
  12. 52:53Case study: Sorted ranges
  13. 58:55Summary and conclusion
~/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.