Boost logo

Boost :

Subject: Re: [boost] namespace boost?
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2011-01-16 07:07:54

> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
> On Behalf Of Mathias Gaunard
> Sent: Sunday, January 16, 2011 11:18 AM
> To: boost_at_[hidden]
> Subject: Re: [boost] namespace boost?
> On 15/01/2011 19:58, Robert Ramey wrote:
> > Certain names like join, zip, map, copy, etc. ... apear in multiple
> > libraries. I would like to use "using namespace boost" but then I'm
> > afraid that using something like copy will be ambigiuos
> boost::copy is a range-based version of std::copy.
> It's not ambiguous because it doesn't have the same arity.
> Anyway, it's probably not a good idea to do "using namespace boost", just
> you shouldn't do "using namespace std"...

+1 - it will come round and bite you eventually (or some poor unsuspecting

And Boost's many examples should NOT set a bad example by doing "using
namespace boost".

IMO "using boost::a_library::a_function;" is actually much better, despite
being longer, because it makes clear where the function comes from.

Authors NB!


Paul A. Bristow,
Prizet Farmhouse, Kendal LA8 8AB  UK
+44 1539 561830  07714330204

Boost list run by bdawes at, gregod at, cpdaniel at, john at