cppforever.com

The scope of a using directive depends on its location

A using directive applies only within the scope in which it is written.

using namespace std;      // applies everywhere in this file

void f() {
    using namespace std;  // applies only inside f()
}