mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Corrected F.54, part 2
This commit is contained in:
parent
b97f67cd60
commit
63316bc0dc
|
@ -3072,7 +3072,7 @@ It's confusing. Writing `[=]` in a member function appears to capture by value,
|
||||||
|
|
||||||
auto lambda = [=]{ use(i,x); }; // BAD: "looks like" copy/value capture
|
auto lambda = [=]{ use(i,x); }; // BAD: "looks like" copy/value capture
|
||||||
// notes: [&] has identical semantics and copies the this pointer under the current rules
|
// notes: [&] has identical semantics and copies the this pointer under the current rules
|
||||||
// [=,this] and [&,this] are identical in this case, and still confusing in general
|
// [=,this] and [&,this] are not much better, and confusing
|
||||||
x = 42;
|
x = 42;
|
||||||
lambda(); // calls use(42);
|
lambda(); // calls use(42);
|
||||||
x = 43;
|
x = 43;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user