What is the difference between returning *this
or the given argument in implementation of operator= in C++? Is using one of them better or more useful? if yes, why?
class Object {
public:
Object operator=(Object Obj) {
return *this;
}
}
vs.
class Object {
public:
Object operator=(Object Obj) {
return Obj;
}
}