Boost logo

Boost :

Subject: Re: [boost] [signals2] Test failure in C++11 (trivial fix for incorrect usage of boost::optional)
From: Frank Mori Hess (fmh6jj_at_[hidden])
Date: 2014-02-27 18:33:32


On Thu, Feb 27, 2014 at 6:20 PM, Agustín K-ballo Bergé
<kaballo86_at_[hidden]> wrote:
> On 27/02/2014 08:15 p.m., Frank Mori Hess wrote:
>> 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>`?
>

Ah, I wasn't aware optional already had overloaded the comparison
operators with comparisons of optional<T> vs T. A little unfortunate
IMO, it makes optional<bool> a bit of a disaster when any sort of
conversion to bool at all is supported.

-- 
Frank

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk