News for hackers. Stuff that matters.
Re:C++ the Good Parts (2014) by gpderetta on Thursday October 01, 2020 @08:22AM (#24650052)
well, 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.
Re:C++ the Good Parts (2014) by tom_mellior on Thursday October 01, 2020 @10:23AM (#24651133)
Regarding 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.
Re:C++ the Good Parts (2014) by layoutIfNeeded on Thursday October 01, 2020 @10:56AM (#24651551)
No, 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.