File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change 14
14
An implementation may declare library names and entities described in this Clause with the
15
15
\tcode {deprecated} attribute\iref {dcl.attr.deprecated }.
16
16
17
+ \rSec 1[depr.capture.this]{Implicit capture of \tcode {*this} by reference}
18
+
19
+ \pnum
20
+ For compatibility with prior \Cpp {} International Standards,
21
+ a lambda expression with \grammarterm {capture-default}
22
+ \tcode {=}\iref {expr.prim.lambda.capture } may implicitly capture
23
+ \tcode {*this} by reference.
24
+ \begin {example }
25
+ \begin {codeblock }
26
+ struct X {
27
+ int x;
28
+ void foo(int n) {
29
+ auto f = [=]() { x = n; }; // deprecated: \tcode {x} means \tcode {this->x}, not a copy thereof
30
+ auto g = [=, this]() { x = n; }; // recommended replacement
31
+ }
32
+ };
33
+ \end {codeblock }
34
+ \end {example }
35
+
17
36
\rSec 1[depr.static_constexpr]{Redeclaration of \tcode {static constexpr} data members}
18
37
19
38
\pnum
48
67
\pnum
49
68
The \grammarterm {noexcept-specifier} \tcode {throw()} is deprecated.
50
69
51
- \rSec 1[depr.capture.this]{Implicit capture of \tcode {*this} by reference}
52
-
53
- \pnum
54
- For compatibility with prior \Cpp {} International Standards,
55
- a lambda expression with \grammarterm {capture-default}
56
- \tcode {=}\iref {expr.prim.lambda.capture } may implicitly capture
57
- \tcode {*this} by reference.
58
- \begin {example }
59
- \begin {codeblock }
60
- struct X {
61
- int x;
62
- void foo(int n) {
63
- auto f = [=]() { x = n; }; // deprecated: \tcode {x} means \tcode {this->x}, not a copy thereof
64
- auto g = [=, this]() { x = n; }; // recommended replacement
65
- }
66
- };
67
- \end {codeblock }
68
- \end {example }
69
-
70
70
\rSec 1[depr.cpp.headers]{\Cpp {} standard library headers}
71
71
72
72
\pnum
You can’t perform that action at this time.
0 commit comments