4 ms·
I’m still not getting your argument. Why is this not “just adding overloads”?
by saagarjha 8y ago
I’m still not getting your argument. Why is this not “just adding overloads”?
- kbsletten 8y agoSounds like they wanted to be a little more aggressive rather than just putting lipstick on that same pig. By specifying the new method they can clean up the rough edges for performance or ergonomics without breaking existing code.
- CJefferson 8y agoHere's one case that is tricky to get right in c++. At the moment you can call sort(x,y) to sort a range, or sort(x,y,z) to give a comparator. If we allow sort(c) for a container, is sort(c,z) sorting a container with comparator, or a range? It's surprisingly hard to get this right with templates, without concepts.
- mehrdadn 8y agoDo ranges and iterators and comparators even have conflicting requirements? I feel like an object could be all three, in which case it'd be ambiguous what was intended.
- plorkyeran 8y agoNo, there's nothing (other than good taste) which stops you from passing a pair of arguments to std::sort() which would be legal for both std::sort(begin, end) and std::sort(range, comparator).