This only applies to pointers. Expressions of class/struct type (references inclusive) use the more familiar dot notation:
class Whatever {
public:
int x;
void take(int n);
};
class T {
public:
int x;
};
void Whatever::take(int n) {
T t;
T *pt = &t; // pointer
T &tr = t; // reference is basically just an alias
pt->x = n;
(*pt).x = n; // can dereference a pointer, then use like a reference
tr.x = n;
// Same for this.
this->x = n;
(*this).x = n;
}
What may seem odd to you is that this
is a pointer in C++ as opposed to a reference.
See also: Why 'this' is a pointer and not a reference? (Stroustrup introduces this
before he created references in the language.)