Le 04/06/2017 à 14:40, Peter Dimov via Boost a écrit :
Vicente J. Botet Escriba wrote:
* remap_errors seems close to what I've called adapt
`adapt` is a good name. I may adopt it. (Or adapt to it.)
There is one open question. With the given interface, with conversions from T implicit and conversions from an error explicit, consider what happens here:
enum unscoped_error { unscoped_other_error = 7 };
expected
test() { return unscoped_other_error; // returns 7.0 } This seems undesirable. To prevent it, we either need to have both explicit, or both implicit. I'm tending toward the latter (but if an error type is chosen by the variant-like overload resolution, I plan to static_assert on exact match.)
unexpected_type<E> is explicitly constructible from E. expected