B
BigMan
When should one use the using directive (i.e. using namespace)?
When "using" namespaces )BigMan said:When should one use the using directive (i.e. using namespace)?
SirMike said:When "using" namespaces )
I do it this way: when I use more than one namespace i declare variables
like std::variable, mynamespace::variable etc.
When use only one namespace I write "using namespace namespace_name" at
the top of the file.
You're right I wrote it like a dumbHeinz said:But as soon as you are using ony named namespace, you are using multiple namespaces - the global namespace and the named one. So, by your rule, you should never use "using namespace <whatever>".
Jeremy said:only in source files
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.