#include <iostream>
namespace Foo
{
class Baz { };
std::ostream& operator<< ( std::ostream& ostream , const Baz& baz )
{
return ostream << "operator<<\n";
}
}
int main()
{
std::cout << Foo::Baz();
}
I define an operator<<
in the Foo
namespace. Why it can be called from the global scope?