~/talk

What Is a Range in C++?

Talkat C++ on Sea 2024 · 2024-07-02..07-05· [software-architecture]
links:none on file
slides:none on file

C++20 formalizes ranges as types with ranges::begin and ranges::end, plus iterator categories that imply sized range, common range, or borrowed range semantics. Universal references are recommended for range parameters to avoid dangling iterators or hidden moves. Views are lazy code that can own or borrow data (owning_view vs ref view) and can make begin O(n) (filter) or drop an element from input streams (istream_view consumes the fourth value in the example). Sentinels allow faster loops; an unreachable_sentinel enables compile‑time optimization.

AI-written summary · about

  1. 0:00Introduction
  2. 3:15Promoting books and content
  3. 10:26Range definition in C++20
  4. 13:20Ranges as universal references
  5. 25:07Understanding views
  6. 33:16Input ranges quirks
  7. 37:33Size ranges limits
  8. 43:14Common ranges and sentinels
  9. 49:11Summary of key concepts
  10. 50:35Q&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.