Iteration Revisited

<p>“Safety” is the word on everyone’s lips at the moment. Unfortunately for C++ programmers, one of our most fundamental abstractions — iterators — are fraught with danger . Prone to out-of-bounds memory accesses, unexpected invalidation and dangling, iterators are a UB minefield in which even experts can find themselves in trouble.</p> <p>Fortunately there is something we can do about it. In this talk we’ll look at an alternative, safer abstraction for iterating over sequences and introduce a new C++20 library implementing these ideas. We’ll see how we can retain all of the power and flexibility of the existing STL, but greatly reduce the potential for UB through careful design and implementation choices — all while offering compatibility with existing code.</p> <p>We’ll also take a look at performance and examine the cost of universal bounds checking. Spoiler: it’s probably a lot less than you’d think. In fact, we’ll see how code using our new library can actually outperform equivalent C++20 Ranges code in some common situations.</p> <p>If you’re interested in the STL and the ranges and algorithms in C++20 and are looking for an easy-to-use way of making your codebase more resilient, then this is the talk for you.</p>
Image

Tristan Brindle

<p>Tristan Brindle is a C++ consultant and trainer based in London. With over 15 years C++ experience, he started his career working in high-performance computing in the oil industry in Australia before returning home to his native UK in 2018. He is an active member of the ISO C++ Standards Committee (WG21) and the BSI C++ Panel. He is a regular speaker at C++ conferences around the world, and is a director of C++ London Uni, a non-profit organisation offering free introductory programming classes in London and online.</p>

When

July 21-24, 2024

LinkedIn

CppNorth Group