Loading…
Attending this event?
CppNorth 2024, The Canadian C++ Conference
July 21-24, 2024 • Toronto, Canada
At the Microsoft Canadian Headquarters (Suite 4400)
In: CIBC SQUARE, 81 Bay St., Toronto, ON M5J 0E7, Canada
Tuesday July 23, 2024 14:45 - 15:45 EDT
Ranges are one of the major additions of C++20, in which our main abstraction for sequences shifted from iterator-pairs into full fledged concepts, allowing better composability, expressibility and safety when working with bounded and even unbounded one dimensional sequences of data.

The fluent use of the pipe-operator gave us power to write complex functional-style algorithms which are both highly readable and performant. The ranges library, especially with some recent C++23 additions also better exposes us to the notion of 'range-of-ranges' and multi-dimensional spans, which weren't in focus of the STL in prior versions of the language.

One key feature of the STL since the last century was the large number of algorithms and building blocks which seemed woven together and gave us a vocabulary by which algorithms could be expressed with little need to work with raw loops.

Together with the introduction of ranges, the STL has also gained various range-based algorithms (as well as views and adapters), yet most of those algorithms were basic adaptations of the ones that are available in the iterator-pair model.

In a talk from 2002, the primary designer of STL described the process of gathering, curating and solidifying the algorithms in the STL circa 1998 (Stepanov: [STL and its Design Principles](https://youtu.be/1-CmNNp5eag)). My talk aims to apply a similar process to the universe of C++20/C++23 ranges, and propose potential additions to our vocabulary when developing range-based algorithms.

In this talk, we will start with an introduction to the ranges library as an example of a breakthrough library, and discuss various aspects of composability which makes the library shine.

Then, we will go over a variety of algorithms which currently don't exist for ranges, describe their potential value, and discuss whether they can or should be added to the standard.

A few examples of algorithms which will be covered: Algorithms for sorted ranges, such as take_between and histogram, ... Algorithm for ranges-of-(sorted-)ranges, such as merge, set_union, set_intersection, ... Algorithms which might require some helper data structures, such as histogram (for non sorted ranges) Algorithms related to generation and processing of permutations, such as order.

As we go through the various examples, we'll discuss what might be good candidates for addition to the STL (and reference prior talks on the topic), the notion of sorted ranges, and hopefully leave the talk with a good desire to compose algorithms in the brave new world of ranges
Speakers
avatar for Roi Barkan

Roi Barkan

Istra Research
Professional software developer and architect since 2000, Roi's main focus throughout his career was on high performance and distributed systems, implementing complex and innovative algorithms. Roi is the SVP technologies of Istra Research, where he helps creating low latency financial... Read More →
Tuesday July 23, 2024 14:45 - 15:45 EDT
Track C

Attendees (4)


Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

Share Modal

Share this link via

Or copy link