0

I know that we should not add a code like this in a header file:

using namespace std;

but what about this:

namespace foo
{
    class A
    {
     public:
        void add()
        {
             using namespace std;
             // do some work here 
         }
    }
}

As far as I know then std is only brought out into function add and no to any other classes in the name space.

Is it still not acceptable? Why?

mans
  • 17,104
  • 45
  • 172
  • 321

0 Answers0