Sort:  

I think that I like std::ranges the most, because it's obvious what is going on just by looking at it. The C-like version is pretty clean too, but it's quite a bit more complex.