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

[expr.prim.lambda.capture]/8 Add a note explaining when capture is required #5824

Closed
blackteahamburger opened this issue Sep 12, 2022 · 3 comments · Fixed by #5847
Closed
Assignees

Comments

@blackteahamburger
Copy link
Contributor

If a lambda-expression or an instantiation of the function call operator template of a generic lambda odr-uses (6.2) this or a variable with automatic storage duration from its reaching scope, that entity shall be captured by the lambda-expression.

in [expr.prim.lambda.capture]/8 has been moved to [basic.def.odr]/9 because of P0588R1. So now there is no relevant description in [expr.prim.lambda.capture]/8, which can be confusing.

@jensmaurer
Copy link
Member

jensmaurer commented Sep 13, 2022

We could add a cross-reference to basic.def.odr after "odr-usable", which is the first appearance of the term here, if that clarifies things.

Otherwise, I'm not seeing a problem here.

@blackteahamburger
Copy link
Contributor Author

blackteahamburger commented Sep 14, 2022

I think it would be useful to explain it, since it is about lambda-expression after all.

@jensmaurer
Copy link
Member

The standard is not a tutorial. If we have complicated rules, we shouldn't try to paraphrase them (likely incorrectly) in notes; we should add a cross-reference and that's it.

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