I have a piece of code that implemented overload ==. And I had to use it somewhere negatively. But to write !(A == B) for the reader does not seem entirely understandable. Therefore, I implemented this double overload. Does he have any flaws in this? Efficiency wise ?:
struct Foo{ bool operator==(const Foo& other) const{ ....
Bonus: Why does the compiler not use != By default using negation == ?
source share