Subject: Re: [boost] [outcome] Possible extensions/changes to std::experimental::expected
From: Peter Dimov (lists_at_[hidden])
Date: 2017-05-26 11:03:59
Andrzej Krzemienski wrote:
> This is only one way of looking at it. Another one is that I have function
> like, `open_file`, I want it to either return the file handle or the
> information about run-time situation that prevented opening the file.
> "reading from uninitialized `expected`" is no such situation: it is simply
> a bug.
As I say in the paragraph immediately before, if your open_file calls
open_file_impl, feeding it invalid arguments, this is simply a bug. Yet when
open_file_impl returns EINVAL to indicate invalid arguments, and you return
that back to the caller, you end up in the exact same situation.