I am using a library that defines output stream operators (operator<<) in the global namespace. In my own namespace, I was always declaring such operators in the globa
My answer is very similar to the others but in particular, the compiler is trying to find A::operator<<() because it's operating on something in the A namespace. If you want to invoke the one outside the namespace, you can call it explicitly by using
::operator<<(std::cout, A::MyClass();
For smoother syntactic use, put it in the namespace.