``` // already existed; this is a pointer auto foo() auto foo() const auto foo() & auto foo() && { return this->m_member or m_member; }
// proposed; this is still a pointer auto foo() auto&& { return this->m_member or m_member; }
// as opposed to actually added auto foo(this auto&& self) { return self.m_member; // just m_member not possible; } ``` With the latter you are actually forced to use a different coding style for some of member functions.
View all comments
Show parent comment
2
u/amoskovsky Jul 30 '26
I did not mean to change the meaning of `this`
```
// already existed; this is a pointer
auto foo()
auto foo() const
auto foo() &
auto foo() &&
{
return this->m_member or m_member;
}
// proposed; this is still a pointer
auto foo() auto&&
{
return this->m_member or m_member;
}
// as opposed to actually added
auto foo(this auto&& self)
{
return self.m_member; // just m_member not possible;
}
```
With the latter you are actually forced to use a different coding style for some of member functions.