You shouldn't need to do that. Koenig lookup will handle the case where operator<< for type T will be found in the
namespace where T is defined without the need for explicit scoping. In other words,
1 2 3 4 5 6 7 8 9 10
namespace foo {
struct bar {};
std::ostream& operator<<( std::ostream&, const bar& ) { /* ... */ }
}
int main() {
foo::bar b;
std::cout << b << std::endl; // This should compile
}