MyClass& operator=(const MyClass& other)
{
//Implement
return *this;
}
MyClass operator=(const MyClass& other)
{
//Implement
return *this;
}
void operator=(const MyClass& other)
{
//Implement
}
When I test these methods, the result is the same. In almost book I see that the first method(MyClass&) is used more than the second method. what's different between them? Which method is really right and fast? One method return address and the second return value.