If I've understood Raymond Chen correctly, this is dangerous, but I can't work out exactly why. http://gotw.ca/publications/migrating_to_namespaces.htm
To be clear, this is not about global namespace pollution due to headers injecting entire namespaces into the global scope, and it's notabout the general case of using namespace xyzzy;
which some regard as harmful however it's used.
mymodule.h
#include <string>
// using namespace std; -- this would be dangerous, and we should never do it
namespace MyModule
{
using namespace std; // but, why is this dangerous?
string foo();
}
mymodule.cpp
#include "mymodule.h"
namespace MyModule
{
using namespace std;
string foo()
{
return "bar";
}
}