3 ms·
To be fair, most of the examples (and all of the ugly ones, IMO) are warts in today's C++ standard that are being greatly improved in C++23. That said, unless
by klyrs 4y ago
To be fair, most of the examples (and all of the ugly ones, IMO) are warts in today's C++ standard that are being greatly improved in C++23. That said, unless I use it frequently (spoiler: I won't), "this auto&& self" is gonna look weird and I really hope that searching the web for "this auto self" will produce useful hits by the time C++23 is in common use.
- amluto 4y agoI find it quite bizarre that ‘this’ ends up with two names in this construct.
- lionkor 4y agoIt really is bizarre, and this is the first time i've seen "deducing this" used. However, I get the naming so far: `this` can be captured, like [this](int x) { return x + this->x; } which we can use, in thise case, to discern between the local x, and this's x. Super contrived, but it illustrates that "this" may be there, too. Then, if you want to capture the lambda, and `this`. Then you need a new name, you can name it `self`, you can name it `this_lambda`, you can name it `ben` - but not `this` since it's reserved and can actually be used in that scope.