Boost logo

Boost :

Subject: Re: [boost] [outcome] Possible extensions/changes to std::experimental::expected
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-05-30 11:32:14


>> It's disallowed purely to avoid SFINAE on constructors and thus improve
>> compile times.
>
> That's why I mentioned tagged constructors. No SFINAE needed. Something
> like:

If one were to use tagged construction, one would almost certainly use
std::variant's set
(http://en.cppreference.com/w/cpp/utility/variant/variant) or a subset
thereof.

I believe I am right in saying that resolving overloads with a single
parameter is constant time in the same way that resolving function names
is. But resolving overloads with two or more parameters is no longer
constant time.

The other thing is that a large minority of my userbase say they want
implicit construction from both T and E, and they are happy for T and E
to be non-constructible into one another to get it. I don't think it a
large cost to give that to them when E is always an error_code type thing.

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