|
|
"Fredrik Eriksson" <fe79}--at--{yahoo}--dot--{com> wrote:
> The point of namespaces is to prevent name collisions in code that uses
> several libraries (in this specific case, Boost and the standard library).
> Importing whole namespaces destroys that benefit, particularly when done
> at namespace scope.
The point of namespaces is to give you tools to *manage* namespaces. If all you
wanted was a way of naming things differently, then C++, pre-namespace, already
gave you ways of doing that.
one example being:
struct std { class cout { ... }; class endl { ... } };
std::cout << blah() << std::endl;
Namespaces are more than just another scoping qualifier. The whole point of
namespaces is that they give you access to the using statement (with differing
levels granularity, and with aliasing). If all you use namespaces for is to add
an additional scoping qualifier, that you then use in full everywhere in your
code, than you're not really using them properly.
Cheers,
Edouard.
Post a reply to this message
|
|