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.
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.
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk