Closed viboes closed 10 years ago
Why would we like it to be a valid code?
Because the fact that exception_ptr needs a specific factory is already hidden on the expected_traits. In particular the following works as expected accept an unexpected_type
expected<string> e = make_unexpected(1);
and the following works because there is an explicit constructor from cont char* to string
expected<int, string> e = {unexpect, "A"};
I think it's an issue of exception_ptr
itself and not expected.
Ok, closed as invalid.
Currently
fails to compile as
exception_ptr
is not constructible fromint
If we want that this code is well formed, we need to make the
expected_traits<E>::from_error
a variadic function.