While this doesn't answer your question, you do not need to add
using namespace
for every namespace you invoke. In fact, by doing so you're undermining the very reason why these namespaces have been introduced in the first place: avoiding the cluttering of the global namespace.
Without the
using
statement you can still access individual symbols just by adding the name of the namespace as a prefix like this:
std::cout << "hello" << std::endl;
You can even inject singular objects or types from other namespaces into your own if you use them often:
#include <io>
typedef std::ostream ostream;
ostream& cout(std::cout);
void hello() {
cout << "hello" << std::endl;
}
I'm not saying you shouldn't take advantage of the
using
statement ever, I just think it's a bad idea to manipulate your IDE into adding it into every project!
Besides, adding this into your main.cpp file doesn't help for other cpp files. If you really want this to affect all files in your project, add it to stdafx.h instead.