Boost logo

Boost :

Subject: Re: [boost] [signals2] Test failure in C++11 (trivial fix for incorrect usage of boost::optional)
From: Peter Dimov (lists_at_[hidden])
Date: 2014-02-27 08:14:25

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.

Boost list run by bdawes at, gregod at, cpdaniel at, john at