~/talk

Back to Basics: Iterators in C++

Talkat CppCon 2023 · on Tuesday, 2023-10-03· at 14:00· Cottonwood 8/9, 6700 North Gaylord Rockies Boulevard· [rust]
slides:none on file

Covers concrete iterator design decisions: iterator categories (input, forward, bidirectional, random‑access, continuous), why algorithms like sort require random access, and why performance drove the API. Demonstrates concrete failures: vector reallocation invalidates iterators (use erase/refresh or avoid holding iterators), transform needs destination sized or use back_inserter, remove returns a new end, and C++20 filter views cache begin so modifying elements that break the predicate yields undefined behavior. Mentions C++98→20 history and real code fixes.

AI-written summary · about

  1. 0:00Iterators in C++ intro
  2. 1:06Pointers to iterator abstraction
  3. 6:49Why iterators matter
  4. 11:06Basic iterator usage
  5. 17:40Const iterators and categories
  6. 21:40Input iterators explained
  7. 25:38Safe iteration beyond random access
  8. 27:48Iterators glue algorithms
  9. 32:51Raw arrays as iterators
  10. 34:16Generic vs OO design
  11. 35:20Iterator invalidation in vectors
  12. 40:20Writing to iterators UB
  13. 43:37Why remove doesn't remove
  14. 46:28Iterators C++98 to C++20
  15. 47:12Ranges and views C++20
  16. 51:54How filter views work
  17. 53:24Generic print with views
  18. 55:31Views design flaws UB
  19. 58:25Iterators in ranges still matter
  20. 59:33Summary on iterators
  21. 1:00:37Q&A: Custom iterators C++20
~/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.