27 Feb
2014
27 Feb
'14
1:14 p.m.
Frank Mori Hess wrote:
I read the explanation of the problem referred to in the original December post, however it seems to me the bug is in optional's safe-bool implementation under c++11. That is, the expression "max==false" should implicitly convert the optional "max" to a boolean and compile.
The C++11 "explicit operator bool" feature is stricter than the safe bool idiom. !max is fine, because !x is considered a boolean context for x; max == false is not, because x == y is not a boolean context for x or y.