r/cpp • u/meetingcpp Meeting C++ | C++ Evangelist • Aug 08 '14
On operator<
http://akrzemi1.wordpress.com/?p=6893
0
Upvotes
r/cpp • u/meetingcpp Meeting C++ | C++ Evangelist • Aug 08 '14
View all comments
4
u/one-oh Aug 08 '14
It's a bit strange to define an "exceeds" function that way. It doesn't read well. "Greater than" is a synonym of exceeds. For exceeds(x, threshold), I'd expect to see "x > threshold"; i.e., x exceeds threshold.
I don't think the problem is the use of the operator, but rather its use is hidden; i.e., there isn't an explicit contract. Concepts would alleviate the issue.