Boost logo

Boost :

From: John Maddock (jm_at_[hidden])
Date: 2003-08-13 05:33:27


> Current GCC and Intel compilers don't appear to allow using declarations
at
> function scope, according to a bug report.

Also Borland's compiler crashes if there are using declarations inside a
function that will be expanded inline if memory serves.

> Is there any reason not to just move the using declarations to namespace
> scope?
>
> Answering my own queston, I think prefer the solution used in other boost
> code where calls to say std::abs are explicitly qualified, and ifdef
> BOOST_NO_STDC_NAMESPACE then namespace std { using ::abs; } is supplied.
>
> What are the pros and cons of the different approaches?

Personally I prefer, namespace std { using ::abs; } approach, however this
can cause overload ambiguities on vc6 (but this is legacy support now
right?), likewise mixing the two approaches with the same function name
messes up vc6 (overload ambiguities again).

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk