C++20 behaviour breaking existing code with equality operator?
Indeed, C++20 unfortunately makes this code infinitely recursive. Here’s a reduced example: struct F { /*implicit*/ F(int t_) : t(t_) {} // member: #1 bool operator==(F const& o) const { return t == o.t; } // non-member: #2 friend bool operator==(const int& y, const F& x) { return x == y; } private: int t; … Read more