Skip to content
New issue

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

Section E.27 #2200

Closed
petecasso opened this issue May 15, 2024 · 1 comment
Closed

Section E.27 #2200

petecasso opened this issue May 15, 2024 · 1 comment
Assignees

Comments

@petecasso
Copy link

In the Gadget example in this section, there's mention of using a std::pair.

Wouldn't it be more idiomatic to use std::optional, or std::expected here? It seems this section, dealing with not being able to use exceptions should be refreshed, based on language evolution.

@hsutter
Copy link
Contributor

hsutter commented Jun 6, 2024

Editors call: Thanks! The guideline does generally say to 'use error codes' and that you can write your own struct, and std::expected is such a thing so falls under that guidance. The Guidelines don't do C++23 yet but when we do we can consider mentioning std::expected.

@hsutter hsutter closed this as completed Jun 6, 2024
@hsutter hsutter self-assigned this Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants