Arno Schödl
Why Iterators Got It All Wrong — and what we should use instead
#1about 1 minute
The dual role of C++ iterators as elements and borders
C++ iterators, modeled after pointers, are used ambiguously to represent both specific elements and the borders between them.
#2about 1 minute
Writing cleaner code with C++ ranges
C++20 ranges simplify code by reducing the boilerplate of begin() and end() calls required with traditional iterator pairs.
#3about 4 minutes
Using range adapters for lazy transformations
Range adapters like transform allow for lazy evaluation, separating data projection from the search operation for more modular code.
#4about 2 minutes
How filter adapters create ambiguity for borders
The filter adapter demonstrates a flaw where mapping a border from a filtered range back to the original range is ambiguous.
#5about 5 minutes
The core problem with the reverse adapter
The reverse adapter proves that a single .base() method cannot correctly map both elements and borders back to the original range.
#6about 3 minutes
A formal solution with element and border concepts
The fundamental iterator flaw can be solved by introducing two distinct concepts: 'border' for positions between items and 'element' for the items themselves.
#7about 4 minutes
Improving algorithms with nullable elements and better names
Further improvements include making element types nullable to handle 'not found' cases cleanly and using more descriptive algorithm names like binary_find.
#8about 2 minutes
Conclusion and the think-cell range library
The think-cell C++ range library implements concepts like nullable elements and refined algorithms to address the inherent flaws in standard iterators.
#9about 4 minutes
Q&A on iterator invalidation and border types
The speaker addresses audience questions regarding how the border and element distinction interacts with container iterator invalidation and mathematical open or closed intervals.
Related jobs
Jobs that call for the skills explored in this talk.
Matching moments
08:00 MIN
Solving complex problems with advanced range adaptors
Functional Programming in C++
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
04:08 MIN
Building lazy data pipelines with C++20 ranges and views
Functional Programming in C++
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
07:25 MIN
Core design principles and the language evolution trilemma
The Design and Evolution of C++
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
06:50 MIN
C++ availability, ecosystem, and backwards compatibility
101 brilliant things of C++
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
04:19 MIN
Processing large datasets with the iterator pattern and streams
10 must-know design patterns for JS Devs
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
05:24 MIN
Debunking common myths about C++ in constrained systems
C++ in constrained environments
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
06:45 MIN
Writing reusable code with generic programming and templates
101 brilliant things of C++
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
07:50 MIN
Using modern language features for safer code
C++ in constrained environments
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
Featured Partners
Related Videos
C++ Features You Might Not Know
Jonathan Müller
The C++ rvalue lifetime disaster
Arno Schoedl
C++ in constrained environments
Bjarne Stroustrup
101 brilliant things of C++
Andreas Fertig
The Design and Evolution of C++
Bjarne Stroustrup
An (In-)Complete Guide to C++ Object Lifetimes
Jonathan Müller
Functional Programming in C++
Jonathan Müller
Things I learned while writing high-performance JavaScript applications
Michele Riva
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.

Ditec Dr. Kahlich & Langer GmbH
Heidelberg, Germany
Junior
Intermediate
Senior
Python



CONTIAMO GMBH
Berlin, Germany
Senior
Python
Docker
TypeScript
PostgreSQL

infomax websolutions GmbH
Grassau, Germany
Intermediate
Senior
CSS
HTML
JavaScript
TypeScript

Peter Park System GmbH
München, Germany
Intermediate
Senior
Bash
Linux
Python


Speech Processing Solutions
Vienna, Austria
Intermediate
CSS
HTML
JavaScript
TypeScript

Vesterling Consulting GmbH
€50-60K
UML
Software Architecture