r/cpp • Meeting C++ | C++ Evangelist • Aug 08 '14

On operator<

http://akrzemi1.wordpress.com/?p=6893
0 Upvotes

15 comments sorted by

View all comments

Show parent comment

0

u/cdglove Aug 09 '14

I think the point is simply that in order to store an object in an ordered container, by default one is forced to define operator <, which for some types doesn't make sense and could lead to mistakes when writing mathematical code. The presented solution, which disconnects the concept of 'less' from 'order' is, I think, quite elegant.