I often encounter variations of the following problem: You are given two or more lists (as
e.g. std::vector
) of elements and you want to sort them “in parallel”, using one of the lists as
keys. I always found the solutions to these kind of problems to be clunky - but with C++23
(or the excellent range-v3
library) we get a very elegant way of doing this.