On 1/06/2017 19:29, Andrzej Krzemienski wrote:
2017-06-01 1:06 GMT+02:00 Gavin Lambert:
On 31/05/2017 20:44, Andrzej Krzemienski wrote:
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?
Of course. It's a single object containing the single outcome of a method call. There might be multiple related sub-states but it's still a single event with a single result.