~/talk

Implementing Ranges and Views in C++

Talkat C++Now 2024 · 2024-04-29..05-03· [compilers-and-language-design]
links:none on file
slides:none on file

Covers how to implement range adapters and views in C++: building a closure that returns a view, fixing dangling temporaries by moving into an owning view, and using the CRTP helpers and views::all to choose between ref_view vs owning_view lifetimes. Explains subrange sizing causing extra passes (distance may re-traverse chunks), multi-input merges implemented with a heap or as a coroutine via std::generator, and tradeoffs between laziness, iterator category, and performance.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:49What are ranges and views
  3. 10:38Composability and chaining examples
  4. 16:20Overview of standard range views
  5. 24:32Implementing range adapters
  6. 33:44Expression templates and lifetime management
  7. 42:55Views::all and ownership handling
  8. 48:43Lazy evaluation and iterators
  9. 53:19Range categories and refinements
  10. 1:03:29Cons correctness and iterator pitfalls
  11. 1:06:03Iterator customization points
  12. 1:08:52Case study: Sorted range views
  13. 1:28:27Summary and Q&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.