foo& operator= (const foo& f) {
var1 = f.var1, var2 = f.var2;
return *this;
}
foo foo1;
foo foo2;
//...
foo2 = foo1;
ok...
the this pointer in this class points to the object on the left (foo2), the object that is calling this function (the op overload func, =). so why do i have to return *this?
if this (foo2) calls the function, shouldnt it know whats intended?
am i missing something?