Iteration Revisited: A Safer Iteration Model for C++ - Tristan Brindle - CppNorth 2023

Sdílet
Vložit
  • čas přidán 2. 10. 2023
  • www.cppnorth.ca​
    ---
    Iteration Revisited: A Safer Iteration Model for C++ - Tristan Brindle - CppNorth 2023
    “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.
    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.
    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.
    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.
    ---
    Slides: github.com/CppNorth/CppNorth_...
    Sponsored By:
    think-cell: www.think-cell.com/cppnorth
    JetBrains: www.jetbrains.com/
    ---
    Tristan Brindle
    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 2017. 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.
    ---
    CppNorth is an annual C++ conference held in Toronto, Canada.
    - Annual CppNorth C++ conference: cppnorth.ca/
    - CppNorth Twitter: / cppnorth
    ---
    CZcams Videos Edited & Optimised by Digital Medium: events.digital-medium.co.uk
    #cppnorth #cpp #iteration
  • Věda a technologie

Komentáře • 4

  • @matthiasruess419
    @matthiasruess419 Před 7 měsíci +2

    Great talk: What about compilation time in comparison to C++20 Ranges? Debug experience?

  • @pmcgee003
    @pmcgee003 Před 7 měsíci +3

    31:00 'multipass' ... lost meme opportunity 🙂

  • @RajaHarinath
    @RajaHarinath Před 5 měsíci

    Is it "undefined behaviour" to use a cursor from one sequence onto another sequence? e.g., `flux::inc(seq2, flux::first(seq1))`