On Fri, Feb 28, 2014 at 1:30 PM, Peter Dimov
Frank Mori Hess wrote:
Ok, but when you are going over some code and see "x==false", and decide to refactor it to "!x" for all the reasons you've given, you've just broken the code. Because they mean completely different things
for optional<bool>.
Well that's correct. But then again, if I decide to refactor 'x == true' into 'x', this can also break the code if x is some esoteric type such as 'int'. :-)
Allright, I'll just make one more quibble then stop my ranting. Someone writing "x==true" where x is an int to test if x is exactly 1 is just bad code in the first place. However, writing "x==true" where x is an optional<bool> is apparently (at least to some as a recent post indicates) the by-design way a value inside an optional<bool> should be compared. -- Frank