T
tron.thomas
If I remember correctly, in one of his books, Scott Meyers suggests
putting code into a custom namespace rather, and here I might be
paraphrasing, "polluting the global namespace" with type definitions
and such.
Assuming this is a good idea, I'm wondering about what happens when so
many people do the following:
using namespace std;
It seems like such a statement will bring a lot of stuff into the
global namespace, and a lot of it won't be used at all. Most people
only make use of a small portion what contained in the std namespace.
I'm wondering if it isn't better to only declare what someone wants to
use such as:
using std::vector;
using std::cout;
What kind of difference can it make to use either approach for
promoting items for a specific namespace for use in global scope?
putting code into a custom namespace rather, and here I might be
paraphrasing, "polluting the global namespace" with type definitions
and such.
Assuming this is a good idea, I'm wondering about what happens when so
many people do the following:
using namespace std;
It seems like such a statement will bring a lot of stuff into the
global namespace, and a lot of it won't be used at all. Most people
only make use of a small portion what contained in the std namespace.
I'm wondering if it isn't better to only declare what someone wants to
use such as:
using std::vector;
using std::cout;
What kind of difference can it make to use either approach for
promoting items for a specific namespace for use in global scope?