Boost logo

Boost :

Subject: Re: [boost] [outcome] Possible extensions/changes to std::experimental::expected
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-05-29 15:07:07


> Sorry, I probably should have said "since *I assume* outcome<error_code>
> is legal".
>
> I can imagine some scenarios where that might be useful (perhaps as part
> of some error translation code which wants to return a modified value
> but can also fail) but I suppose that would complicate the constructors
> a bit so I can understand why it'd be disallowed, and it should be rare
> enough not to really bite anyone.
>
> (Although tagged constructors to resolve that ambiguity wouldn't be an
> issue if you could only create an errored outcome with a helper like
> make_unexpected...)

It's disallowed purely to avoid SFINAE on constructors and thus improve
compile times.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/

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