Comment on Curious C++ Lambda Examples: Recursion, constexpr, Containers C++23 includedparentComments−einpoklum4yBecause `this auto&&` was not introduced to allow for recursive lambads. That's just a happy (though not very interesting) side effect. It was introduced so that you don't have to write duplicated code such as: class Awesome { // ... foo& my_method() { /* ... */ } const foo& my_method() const { /* ... */ } }; and the extra duplication for lvalues and rvalues.
Comments
Because `this auto&&` was not introduced to allow for recursive lambads. That's just a happy (though not very interesting) side effect. It was introduced so that you don't have to write duplicated code such as:
and the extra duplication for lvalues and rvalues.