Skip to content

Conversation

ccotter
Copy link
Contributor

@ccotter ccotter commented Jan 7, 2023

Opening to get a question answered, along with a possible editorial fix. The standard document does not refer to "default capture," but always refers to "capture-default" (when referring to the language grammar). Is there a preferred way to say this? Would it be cleaner to stick to a single phrase, "capture default" as done in my PR here?

Note: cppreference uses "capture default" or "capture-default" in all places, although I will add that I just changed the lone occurrence of "default capture" to be consistent with the other 15 references on this page.

@cubbimew
Copy link
Member

cubbimew commented Jan 7, 2023

These are not precisely the same thing:
capture-default is syntactic element of lambda-capture which is a syntactic element of lambda-introducer, etc.
"default capture" is semantics; it is what the lambda in which capture-default appears does to variables that are used but aren't listed explicitly in the introducer.

Speaking for cppreference, some of us very much prefer using semantics over grammar productions unless talking about syntax, since our audience are programmers rather than compiler writers, but it's an endless tug-of-war with "what's in the standard" editors. Your edit was OK though, that bit was talking about the syntactic element.

@ccotter
Copy link
Contributor Author

ccotter commented Jan 8, 2023

Thanks. It looks like the standard only ends up referring to the syntactic element.

In this PR, I think the one place that refers to the syntactic element is on line 4135 (the first reference): Flag any lambda capture-list that specifies a default capture and also captures.. -> capture-default. Although, since this is a different document from the standard itself with a potentially different audience etc, I'll take your guidance on how to proceed.

@hsutter
Copy link
Contributor

hsutter commented Jan 12, 2023

Editors call: Thanks!

@hsutter hsutter merged commit 1748ebb into isocpp:master Jan 12, 2023
@hsutter hsutter self-assigned this Jan 13, 2023
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 this pull request may close these issues.

3 participants