Boost logo

Boost :

Subject: Re: [boost] Reforming Boost.System and <system_error> round 2
From: Richard Hodges (hodges.r_at_[hidden])
Date: 2018-01-16 16:26:49


> With my limited knowledge of Boost.Outcome, I don't think so. An outcome
is supposed to carry a value or error, and `error_code` carries only the
error code.

Actually the code() part of error_code is implicitly an outcome. Some code
values are not errors, others are.

It's just that error_code, being modelled on things like errno and
GetLastError(), is implicitly archaic.

If you'll forgive the expression, I feel we could do better than merely try
to polish a turd from the 1950s.

On 16 January 2018 at 17:15, Andrey Semashev via Boost <
boost_at_[hidden]> wrote:

> On 01/16/18 19:10, Andrzej Krzemienski via Boost wrote:
>
>> 2018-01-16 17:05 GMT+01:00 Andrey Semashev via Boost <
>> boost_at_[hidden]>
>> :
>>
>> On 01/16/18 18:56, Olaf van der Spek via Boost wrote:
>>>
>>>>
>>>> Can't the is_error bool be stored in the ec object itself, at
>>>> construction time?
>>>>
>>>
>>> Actually, I like this idea. I've modified my benchmark accordingly and it
>>> shows nearly identical performance as the current `std::error_code`:
>>>
>>> Experimental test: 253654 usec, 394237820.022550 tests per second
>>> Experimental2 test: 46353 usec, 2157357668.327832 tests per second
>>> std test: 45981 usec, 2174811335.116679 tests per second
>>>
>>
>> This is now getting closer to Boost.outcome, isn't it?
>>
>
> With my limited knowledge of Boost.Outcome, I don't think so. An outcome
> is supposed to carry a value or error, and `error_code` carries only the
> error code.
>
>
> _______________________________________________
> 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