4 ms·
I wasn't talking about ranges, I was talking about the grandparent's three-line wrapper function.
by tom_mellior 6y ago
I wasn't talking about ranges, I was talking about the grandparent's three-line wrapper function.
- gpderetta 6y agowell, first of all that wrapper uses std::being/std::end which wasn't available in c++98, second std::sort is "easy" as it is mutating and it doesn't return anything. For other algorithms you want to return ranges (For composability) and things get more complicated.
- tom_mellior 6y agoRegarding the first point: True, but the wrapper could also have been written in terms of foo.begin()/foo.end(), no? Second point: Yes, I would want the easy case solved. Obviously, if an algorithm cannot be wrapped like this, then I'm not asking for the impossible.
- layoutIfNeeded 6y agoNo, at least not without a separate overload for C-style arrays. If you don’t care about C arrays then yes, .begin/.end could work.