And finally, std::variant doesn't implement multiple argument converting constructors. And I figured WG21 know what they're doing.
Some design features translate between similar but different classes, and some do not. variant
has no idea what the alternatives are or what they represent, which is reflected in the way it treats them. So you use in_place_index<3> for the fourth alternative, for example.
I don't understand. variant<...> knows exactly what the alternatives
are. It surely would be straightforward to look at some Arg&&...
sequence and do std::is_constructible
In our case, there are only two alternatives and they have known semantics.
Actually, they don't have known semantics. We don't know anything about them. The concept pattern matching machinery *may* give them known semantics, but result/outcome don't know anything about that at the constructor level.
Also variadic templates are slow :(
If that's the problem, you could use
template
result( A1&& a1, A2&& a2, A&&... a ); which would be rejected immediately in the one-arg case and hence shouldn't affect its compile times. I SFINAE on sizeof...(A) >= 2 instead, but I might switch.
Oh good idea. Logged to https://github.com/ned14/outcome/issues/56 Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/