Affected subclause: [over.match.oper]
Change:
Equality and inequality expressions can now find
reversed and rewritten candidates
. Rationale:
Improve consistency of equality with three-way comparison
and make it easier to write the full complement of equality operations
. Effect on original feature:
Equality and inequality expressions between two objects of different types,
where one is convertible to the other,
could invoke a different operator
. Equality and inequality expressions between two objects of the same type
could become ambiguous
.
struct A {
operator int() const;
};
bool operator==(A, int);
int check(A x, A y) {
return (x == y) +
(10 == x) +
(10 != x);
}