It is the second time this week I see a C++ codebase where the data members are accessed through the this
pointer. For example,
class Foo
{
int m_x;
...
void bar() {
int stuff = this->m_x; // why not = m_x?
...
}
}
You can see this in AmgX for example (Nvidia AmgX solver). What does it get us?
The only advantage I could think of is that if the function parameters happen to shadow data members, it will make it obvious which data you are using. However, I consider shadowing variables a pretty bad practice in the first place...
Anything I might have missed?