3 ms·
Does C++ Pair<> define operator< and operator>? That's surprising, and for me looks completely uncalled for. EDIT: Just looked into Haskell (because it's easi
by marcosdumay 9y ago
Does C++ Pair<> define operator< and operator>?
That's surprising, and for me looks completely uncalled for.
EDIT: Just looked into Haskell (because it's easier), and tuples do derive Ord there. Is there some universal convention I'm missing?
- throwaway613834 9y ago> Is there some universal convention I'm missing? Tuples are always compared lexicographically, is the universal convention. Not sure if that's what you might be missing?
- khedoros1 9y ago> Does C++ Pair<> define operator< and operator>? It does. std::sort(pairarray.begin(),pairarray.end()) works about how you'd expect, as long as operator< is defined for the constituent types of the pair.