This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: use of type_traits
On Thu, Jan 27, 2005 at 12:36:43PM +0100, Paolo Carlini wrote:
> Benjamin Kosnik wrote:
>
> >Sorry if this has been discussed already.
> >
> >
> You may find interesting this thread:
>
> http://gcc.gnu.org/ml/libstdc++/2004-07/msg00224.html
The non-polluting macros might be the best, long-term solution.
I've ruled out something like this, due to ODR violations:
#ifdef _GLIBCXX_ADD_TR1_TO_STD
namespace std { namespace tr1 {} }
namespace __gnucxx_tr1 = std::tr1;
namespace std {
#else
namespace __gnucxx { namespace tr1 {} }
namespace __gnucxx_tr1 = __gnucxx::tr1;
namespace __gnucxx {
#endif
namespace tr1 {
// type traits definitions...
} }
But how about always declaring the TR1 traits in our private namespace
and conditionally pulling them into std with a strong using? If strong
using works properly (there are currently a couple of bugs IIRC) that
should do what we want, shouldn't it?
Alternatively, for a _really_ shoddy attempt, we could just declare them
in our namespace and use (non-strong) using decls to pull them into std.
That wouldn't be conforming, but it's only a TR so we aren't obliged to
be strictly conforming. Maybe.
jon
--
There are only 10 types of people in the world -
Those who understand binary, and those who don't.