Comparison operators got an upgrade in C++20 (along with introduction of <=>
), which among other things makes ==
symmetric, lets you skip defining !=
(a != b
behaves as !(a == b)
when there's no custom !=
), and so on.
This wasn't done for +
. At least one reason is that (unlike ==
) it's often not symmetric (e.g. for std::string
).