Boost logo

Boost :

Subject: Re: [boost] [system] Would it be possible to trial a breaking change to Boost.System and see what happens?
From: Vinnie Falco (vinnie.falco_at_[hidden])
Date: 2018-01-22 17:08:50


On Mon, Jan 22, 2018 at 3:54 AM, Asbjørn via Boost
<boost_at_[hidden]> wrote:
> I also found the implicit bool conversion was very error prone, as I managed
> to trip myself a few times when writing examples. So I got rid of it, and
> introduced an explicit op_result.success() method which does a virtual call
> to the category.

I would prefer writing `if(ec.success())` and `if(ec.failed())` over
`if(! ec)` and `if(ec)` respectively.

Which brings up an interesting idea. Perhaps we can first propose to
add `error_code::success()` and `error_code::failed()` and get that
in, as an immediate improvement over writing legible code. And
deprecate (but do not forbid) the use of the `bool` conversion. Then
after several years and more experience in the field contemplate the
change allowing `error_category` to define the meaning of success,
secure in the knowledge that any code which is written or modified to
use `success()` and `failed()` will automatically work.

Thanks


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