Boost logo

Boost :

Subject: Re: [boost] PR: Remove safe_bool idiom from boost.tribool
From: Robert Ramey (ramey_at_[hidden])
Date: 2018-05-22 04:47:18


On 5/21/18 6:02 PM, Peter Dimov via Boost wrote:
> Robert Ramey wrote:
>
>> > I'm strongly opposed to downgrading from safe_bool to implicit bool.
>>
>> I made my argument why this is good idea.  What's wrong with my argument?
>
> Defining a conversion to bool enables unwanted operations such as
>
>    tribool b1, b2;
>
>    b1 < b2;
>    b1 + b2;
>    b1 + 5;
>    b1 * 2;
>
> That's the whole point of "safe bool", to avoid those.

Right.

But - Since the have been prohibited by the current safe_bool, there are
none in current code. So the change won't break anything.

Finally. I believe that these are compile time errors in C++17. So
safe_bool isn't needed to prevent them anymore anyway.

Robert Ramey

>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


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