Skip to content

[expr.prim.lambda.capture]/12 Lengthy but redundant wording #9292

Description

@BlowingWind314

[expr.prim.lambda.capture]/12 says

An entity is captured by reference if it is implicitly or explicitly captured but not captured by copy.

However, [expr.prim.lambda.capture]/8 says

An entity is captured if it is captured explicitly or implicitly.

So it's enough to say

An entity is captured by reference if it is implicitly or explicitly captured but not captured by copy.

Similarly [expr.prim.lambda.capture]/17

[Note 10: If a non-reference entity is implicitly or explicitly captured by reference, invoking the function call operator of the corresponding lambda-expression after the lifetime of the entity has ended is likely to result in undefined behavior. — end note]

Or is it intentional to use a verbose tone to remind readers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions