Boost logo

Boost :

Subject: Re: [boost] [system] Would it be possible to trial a breaking change to Boost.System and see what happens?
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2018-01-21 22:07:17


On 20/01/2018 07:02, Robert Ramey wrote:
>> Whether it was intended or not, established practice is to treat the bool
>> conversion of error_code as false==success and true==failure.
>
> It may be established, but it's not good practice. It's an example where
> implicit conversion SEEMS to make things simpler and more expressive,
> but it ends up making things more error prone.

How about if it were spelled

   if (error)

instead? While granted this is technically not what the implementation
does, it is what most people intend anyway and does work with all
standard error_category implementations. The intent does seem far less
ambiguous this way, does it not?


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