...
Code Block | ||||
---|---|---|---|---|
| ||||
auto g() { int i = 12; return [&] { i = 100; return i; }; } void f() { int ij = g()(); } |
Compliant Solution
...
Code Block | ||||
---|---|---|---|---|
| ||||
auto g() { int i = 12; return [=] () mutable { i = 100; return i; }; } void f() { int ij = g()(); } |
Noncompliant Code Example
...