Boost logo

Boost Users :

Subject: Re: [Boost-users] conflicting intmax_t definitions - Boost 1.53 and gcc 4.8 incompatibility?
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2014-01-20 20:23:31


On 21/01/2014 02:21, Quoth John Maddock:
> Boost does define it's own intmax_t etc *in namespace boost*, if you
> import these into the global namespace then expect things to break,
> sorry but that's the way it's *always* been. My guess is it worked
> before because the Boost and std lib versions happened to be identical
> by chance.

My rule of thumb is to never ever do a "using namespace" in the global
namespace in a header file, or someplace prior to the point after all
#includes in a cpp file. (And be wary of doing it even then.)

Strategic "using" or even "using namespace" from other namespaces can be
useful, though.


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