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

[optional] Use x.has_value() instead of bool(x) #4901

Closed
jwakely opened this issue Sep 13, 2021 · 1 comment · Fixed by #4929
Closed

[optional] Use x.has_value() instead of bool(x) #4901

jwakely opened this issue Sep 13, 2021 · 1 comment · Fixed by #4929
Assignees

Comments

@jwakely
Copy link
Member

jwakely commented Sep 13, 2021

During last week's LWG telecon there was a strong preference expressed for using has_value() or prose "contains a value" instead of bool(*this).

Should we do the same for std::optional?

@jensmaurer
Copy link
Member

At least for those parts where we talk about the boolean conversions, yes. I'm not sure adjusting "*this contains a value" yields a net benefit.

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

Successfully merging a pull request may close this issue.

2 participants