Is there a difference between
class MyString {
...
MyString &operator=(MyString other) {
swap(s, other.s);
return (*this);
}
};
and
class MyString {
...
MyString &operator=(MyString other) {
swap(s, other.s);
return *this;
}
};
I read in some other posts that adding parenthesis indicates that you are returning by reference rather than value. But in case the return type is defined, it doesn't seem to make a difference.