You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[this] shall not appear within the declaration of either a static member function or an explicit object member function of the current class (although its type and value category are defined within such member functions as they are within an implicit object member function).
Multiple implementations have misimplemented this rule for the case of this appearing in a lambda that has an explicit object parameter:
Here, I think the three uses of this are not within the declaration of an explicit object member function, because a lambda-expression is not a function declaration at all. And this example should be valid -- there's no problem with using this in a lambda with an explicit object parameter, because the this refers to the object parameter of the enclosing function declaration, not the lambda-expression.
Perhaps it'd be useful to add a note to this parameter to remind the reader that a lambda-expression is not a declaration of a function, so you need to keep looking outwards to find the function you're looking for.
The text was updated successfully, but these errors were encountered:
[expr.prim.this]/3 says:
Multiple implementations have misimplemented this rule for the case of
this
appearing in a lambda that has an explicit object parameter:Here, I think the three uses of
this
are not within the declaration of an explicit object member function, because a lambda-expression is not a function declaration at all. And this example should be valid -- there's no problem with usingthis
in a lambda with an explicit object parameter, because thethis
refers to the object parameter of the enclosing function declaration, not the lambda-expression.Perhaps it'd be useful to add a note to this parameter to remind the reader that a lambda-expression is not a declaration of a function, so you need to keep looking outwards to find the function you're looking for.
The text was updated successfully, but these errors were encountered: