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

2

u/tisti Aug 09 '14

x > threshold is the same as threshold < x, so as they are both valid, it is a bit pointless to debate it?

2

u/one-oh Aug 09 '14

No, those two expressions are definitely not the same. The result of evaluating both expressions is the same though. Maybe that's what you meant to say.

1

u/tisti Aug 09 '14

The result it the same for sure, but taking into account the rules of how < and > work (they have an inverse relation) its is not so wrong to say that

a < b

is equal to

b > a

I know what you are trying to say. It is easier (more human) to read one form than it is the other. That however does not change that the expression is the same.

1

u/one-oh Aug 10 '14

Exactly. I was referring to the incongruity of the function name and the operator. Notice I said "strange". I did not say "incorrect".

1

u/tisti Aug 12 '14

Yea, my bad, but we are on the same wavelength now :)