Relative Content

Tag Archive for c++functionclassparametersmember

Is the implicit parameter of a member function `this` or `*this`?

I was told that member function of a C++ class has an implicit parameter this which is a pointer to the object. But it seems to me that this parameter should be the object, not a pointer to it. For example, the overloaded operator + in expression obj1 + obj2 has its left operand as the first parameter of operator+ member function, which is the object obj1 instead of its address. So I would like to be confirmed whether the implicit parameter of a member function in C++ is *this or this.