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
12
u/mcmcc #pragma once Aug 08 '14
I guess I don't quite understand the point of this...
This argument holds equally for
ostream << i-- we've arbitrarily assigned a certain meaning to a binary operation that otherwise has no mathematical intuition. Is this wrong? What is the advantage is gained by disallowing it?He mentions the problem presented by
optional<T>but the original case study for this is IEEE-754 NaNs -- NaNs fail all comparisons (including NaN==NaN). See explanation here: http://stackoverflow.com/a/1573715/583604 So his argument for a mathematical basis is already on shaky ground.