We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.or_else
Today I commented on P2505R0 that it should be designed to permit this code:
std::expected<Connection, PortableError> convertError(SSLError e) { return std::unexpected(PortableError(e)); } std::expected<Connection, SSLError> e1 = ~~~; std::expected<Connection, PortableError> e2 = e1.or_else(convertError);
This doesn't work with tl::expected today. I plan to submit a PR for this feature, but will wait for some of my preliminary PRs to get merged first.
tl::expected
The text was updated successfully, but these errors were encountered:
As a workaround, this is exactly what .map_error does.
.map_error
Example:
tl::expected<Connection, PortableError> translateError(SSLError e) { return tl::make_unexpected(PortableError(e)); } tl::expected<Connection, PortableError> s = e1.map_error(translateError);
Sorry, something went wrong.
No branches or pull requests
Today I commented on P2505R0 that it should be designed to permit this code:
This doesn't work with
tl::expected
today. I plan to submit a PR for this feature, but will wait for some of my preliminary PRs to get merged first.The text was updated successfully, but these errors were encountered: