Boost logo

Boost Users :

Subject: Re: [Boost-users] boost and std collisons in c++0x
From: Mickael Wolff (mickael_at_[hidden])
Date: 2009-02-05 13:04:14


Ein Held a écrit :

> As of now, we move both, ::boost- and ::std-namesspace in the global
> namespace via using xxx. This is exactly what we want - boost and the
> stl are both such fundamental libraries that using an explicit namespace
> specifier everytime we want to use content of these namespaces is not
> accaptable. This would just blow the code and make it unreadable.

   This is very funny. In fr.comp.lang.c++, we had a troll about using
usage. It appears that a lot of contributor use qualified names in
professionnal code, to avoid namespaces collision and improve readness.
Because when we use a string, I can need to know where it come from.
That's an example.
   The second point we raised is the bad habit of beginners, who
massively use the using namespace directive at global scope, and worst
in header's global scope !

   Daniel Lidström provided a good way to assure a consistent use of
tools that comes from differents libraries. He imports objects and
functions he need in a project specific namespace. This is a very soft
approach, because you can support evolution and migrations more easily,
at the cost of basics macros.

> #include <iostream> //This one might include <array>
> using namespace std;

   Bad, very bad.
   Be aware that namespace encapsulation have no interest if you cancel it.

-- 
Mickaël Wolff aka Lupus Michaelis
Racine <http://lupusmic.org>
Blog   <http://blog.lupusmic.org>

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net