Operator overloading for nested struct only working as member or friend function – Debian
This C++ code compiles and runs perfectly, as I expect: template <typename T> struct S { T *p; }; template <typename T> bool operator == (S<T> &a, S<T> &b) { return a.p == b.p; } int main () { int…