How ref qualifiers led to deducing this
5 comments · 95% upvoted · source · other discussions
5 comments · 95% upvoted · source · other discussions
This feature is great and I use it, but not did it get messy if you do much more than a getter. Having to spam forward<Self> everywhere gets ugly quick and makes me question if I should just do things the old way.
I can see that, you got to deal with lifting things into the generic space. Plus that supporting older standards isn't possible. Which ref qualifiers allow for.
You can't
= deletea specific overload with deducing this, but you can apply constraints to accomplish something similar.__christo4us 13 points · May 2026
Member functions that make use of deducing this are actually templates so you can
=deletea specific template specialization: ``` struct foo { void f(this auto &&self) { /* ... / } // exactly the same as template<typename T> void f(this T &&self) { / ... */ } };template<> void foo::f(this foo &&self) = delete; template<> void foo::f(this const foo &&self) = delete; ```
meetingcpp [OP] 0 points · May 2026 · Meeting C++ | C++ Evangelist
Right...