27 Feb
2014
27 Feb
'14
11:20 p.m.
On 27/02/2014 08:15 p.m., Frank Mori Hess wrote:
On Thu, Feb 27, 2014 at 8:14 AM, Peter Dimov
wrote: 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.
Even if optional is changed to use explicit operator bool, does that exclude the possibility of adding free operator== and operator != methods which take one argument as an optional and one argument as a bool? Would such overloads actually introduce any dangerous behavior?
What would those overloads do for `optional<bool>`? Regards, -- Agustín K-ballo Bergé.- http://talesofcpp.fusionfenix.com