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.
Wilken GmbH
Ulm, Germany
Senior
Kubernetes
AI Frameworks
+3
Matching moments
03:31 MIN
The value of progressive enhancement and semantic HTML
WeAreDevelopers LIVE – You Don’t Need JavaScript, Modern CSS and More
02:49 MIN
Using AI to overcome challenges in systems programming
AI in the Open and in Browsers - Tarek Ziadé
09:00 MIN
Navigating the growing complexity of modern CSS
WeAreDevelopers LIVE – You Don’t Need JavaScript, Modern CSS and More
06:46 MIN
How AI-generated content is overwhelming open source maintainers
WeAreDevelopers LIVE – You Don’t Need JavaScript, Modern CSS and More
03:58 MIN
Making accessibility tooling actionable and encouraging
Developer Time Is Valuable - Use the Right Tools - Kilian Valkhof
11:32 MIN
The industry's focus on frameworks over web fundamentals
WeAreDevelopers LIVE – Frontend Inspirations, Web Standards and more
03:07 MIN
Final advice for developers adapting to AI
WeAreDevelopers LIVE – AI, Freelancing, Keeping Up with Tech and More
08:07 MIN
Exploring modern JavaScript performance and new CSS features
WeAreDevelopers LIVE – AI, Freelancing, Keeping Up with Tech and More
Featured Partners
Related Videos
The C++ rvalue lifetime disaster
Arno Schoedl
C++ Features You Might Not Know
Jonathan Müller
C++ in constrained environments
Bjarne Stroustrup
101 brilliant things of C++
Andreas Fertig
Functional Programming in C++
Jonathan Müller
The Design and Evolution of C++
Bjarne Stroustrup
An (In-)Complete Guide to C++ Object Lifetimes
Jonathan Müller
Eternal Sunshine of the Spotless Programming Language
Stefan Baumgartner
Related Articles
View all articles



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


Der STANDARD
Vienna, Austria
Senior
Next.js
TypeScript

Visonum GmbH
Remote
Junior
Intermediate
React
Redux
TypeScript

Der STANDARD
Vienna, Austria
Senior
TypeScript
Amazon Web Services (AWS)


Confideck GmbH
Vienna, Austria
Remote
Intermediate
Senior
Node.js
MongoDB
TypeScript



Servus Intralogistics Gmbh
Dornbirn, Austria
€53K
C++
Software Architecture
Test Driven Development