~/talk

C++20 Ranges for Beginners

Talkat Core C++ 2025 · on Sunday, 2025-10-19· [c-and-cpp]
links:none on file
slides:none on file

C++20 ranges provide concrete tactics: use lazy views and the pipeline syntax to compose filter/transform/copy without copies, use projections to sort by a field, and use sentinels (e.g. unreachable_sentinel) for infinite sequences. Examples show views are cheap to create but lazy, begin can be cached causing surprising O(N) first-call costs, size() or index may be unavailable depending on the source container, and passing views by value can hide costly copies — prefer forwarding or overloads that accept views to avoid hidden allocations.

AI-written summary · about

  1. 0:00Introduction to C++20 Ranges
  2. 1:10Why use Ranges?
  3. 2:39Range components and concepts
  4. 4:05Concepts in C++20
  5. 6:12Projections in sorting
  6. 7:19What are Views?
  7. 8:04Sentinels for infinite ranges
  8. 8:49First View example
  9. 9:32Transform and copy operations
  10. 10:17Chaining Views with pipe syntax
  11. 11:46View API differences
  12. 12:51Drop and size limitations
  13. 14:18View operations complexity
  14. 16:05Filter View limitations
  15. 18:33Common compilation errors
  16. 21:21Fixing const and reference issues
  17. 23:10Overload resolution solutions
  18. 24:18Sentinels explained
  19. 25:24Summary and use cases
  20. 26:51Q&A session
~/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.