This is a pointer, and *this is a pointer that has been dereferenced.
If you had a function that returned this, it would be a pointer to the current object, but a function that returned *this would be a "clone" of the current object, created on the stack unless you defined the method's return type to be a reference.
A small application that demonstrates the difference between working with copies and working with references:
#include <iostream>
class Foo
{
public:
...READ MORE
Jun 28, 2022
in C++
by
Damon
• 4,960 points
•
700 views