Date: Thu, 9 Oct 2025 18:32:21 +0200
In [expr.prim.lambda.capture].
as well known, p(7.3) reads as follows since C++20:
"
*The implicit capture of *this is deprecated when the capture-default
<https://eel.is/c++draft/expr.prim.lambda#nt:capture-default> is =;
see [depr.capture.this] <https://eel.is/c++draft/depr.capture.this>.
<https://eel.is/c++draft/expr.prim.lambda#capture-7.sentence-3>*
"
Then, shouldn't p2 refine the Example1 as follows ?
from:
"
[=, this]{ }; // OK, equivalent to [=]
"
to:
"
[=, this]{ }; // OK, deprecated equivalence to [=]
"
Tiny, but consistent change, despite Examples are not formally part of the
standard,
but the deprecation implies there is no guarantee about the equivalence,
isn't it ?
as well known, p(7.3) reads as follows since C++20:
"
*The implicit capture of *this is deprecated when the capture-default
<https://eel.is/c++draft/expr.prim.lambda#nt:capture-default> is =;
see [depr.capture.this] <https://eel.is/c++draft/depr.capture.this>.
<https://eel.is/c++draft/expr.prim.lambda#capture-7.sentence-3>*
"
Then, shouldn't p2 refine the Example1 as follows ?
from:
"
[=, this]{ }; // OK, equivalent to [=]
"
to:
"
[=, this]{ }; // OK, deprecated equivalence to [=]
"
Tiny, but consistent change, despite Examples are not formally part of the
standard,
but the deprecation implies there is no guarantee about the equivalence,
isn't it ?
Received on 2025-10-09 16:32:37
