Boost logo

Boost :

Subject: Re: [boost] [outcome] To variant, or not to variant?
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2017-06-01 07:29:58


2017-06-01 1:06 GMT+02:00 Gavin Lambert via Boost <boost_at_[hidden]>:

> On 31/05/2017 20:44, Andrzej Krzemienski wrote:
>
>> 2017-05-31 10:26 GMT+02:00 Gavin Lambert:
>>
>>> Anyway, the point is that this could actually transport multiple things;
>>> in particular as above both an error_code and an exception_ptr; perhaps
>>> set(error_code) could construct an exception as well, although I've
>>> explained elsewhere why I don't like that option.
>>>
>>
>> In your mental model what is the interpretation of the situation when you
>> have both an error_code and an exception_ptr?
>>
>
> Mostly where error() returns the error_code and exception() returns the
> system_error(error()), so that the caller could choose to treat it either
> way, as you'd expect.
>
> Conceivably there could be cases where someone might want to have a
> different type of exception (eg. errc::invalid_argument plus
> std::out_of_range or a derived type, which might convey some additional
> information), although that could also be a can of worms best left unopened.

So, are you saying that exception() and error() observe the same "failure
report", just in two different ways?

Regards,
&rzej;


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