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.monadic] Should we remove invented variable declarations? #6256

Open
frederick-vs-ja opened this issue May 18, 2023 · 0 comments
Open

Comments

@frederick-vs-ja
Copy link
Contributor

[optional.monadic]/8 currently states:

Mandates: U is a non-array object type other than in_place_t or nullopt_t. The declaration
U u(invoke(std::forward<F>(f), value()));
is well-formed for some invented variable u.

In this declartion, invoke(std::forward<F>(f), value()) is a prvalue of cv U since U is remove_cv_t<invoke_result_t<F>>, so the declaration would be well-formed as long as U is well-formed.

Should we just say U is well-formed instead, or don't explicitly say any additional requirement given it is implicitly required that U is well-formed?

expected::transform and expected::transform_error have the same issue.

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

1 participant