Using a namespace twice

c++, namespaces

Solution

It depends what you mean by 'include'. Saying:

using namespace std;    
...    
using namespace std:

is OK. But saying:

namespace X {
   ...
namespace X {

would create a nested namespace called X::X, which is probably not what you wanted.

Problem

In c++ Is it OK to include same namespace twice? compiler wont give any error but still will it affect in anyway Thanks, EDIT: I meant ``` using namespace std; // . . STUFF using namespace std; ```

Original source