-----Original Message----- From: Boost-users [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Gavin Lambert Sent: Tuesday, January 21, 2014 1:24 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] conflicting intmax_t definitions - Boost 1.53 and gcc 4.8 incompatibility?
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.
+1 You may be able to get away with using namespace std globally, but doing this with Boost namespace (or any other) is asking for trouble. If it's not you, it may be some other unsuspecting and entirely innocent user - who will be even more perplexed than you! Avoid unnecessary program-miles, keep namespace declarations local :-) Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com