Risks of using "using namespace"

One risk is that if multiple libraries are being #included there might be multiple namespaces with the same name, thus causing a namespace clash if you try to call upon a function which is named the same as a different function from another library with the same namespace.

Another risk is that if you are using multiple libraries and you are using “using namespace” then to other people who read your code it is not obvious which library a given function is called from.

Privacy & Terms