Foe пример мы heveОператор C++ ==, важно ли проверить самоопределение?
bool Foo::operator==(const Foo& other) {
return bar == other.bar;
}
ли важно это Чек и тот же объект, как это?
bool Foo::operator==(const Foo& other) {
if (this == &other) {
return true;
}
return bar == other.bar;
}