This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Question/problem related to _Bool in type_traits.h
- To: libstdc++ at gcc dot gnu dot org
- Subject: Re: Question/problem related to _Bool in type_traits.h
- From: Stephen M. Webb <stephen at bregmasoft dot com>
- Date: Tue, 16 Oct 2001 08:36:19 -0400
- Organization: CRYPTOCard Corporation
- References: <p05100304b7f12c0840c0@[17.202.44.152]>
- Reply-To: stephen at breagmasoft dot com
On Mon, 15 Oct 2001, Ira Ruben wrote:
> Sometime in the past, specifically according to gcc/ChangeLog.2
> (8/29/99), Zack Weinberg added a #define for '_Bool' to stdbool.h to
> define it as the type 'bool'. This means that now with gcc 3.x you
> can no longer include both stdbool.h and libstdc++'s type_traits.h in
> the same compilation because type_traits.h defines a _Bool template.
> It didn't in 2.95.x days which is why this wasn't a problem until now
> with gcc 3.x.
>
> Does anyone have a suggested (permanent) fix for this problem. For
> the time being I've added a #undef _Bool just before the template
> definition in type_traits.h.
The problem is that the names in type_traits.h are in the global namespace.
I gather they weren't put into std:: because they aren't standard, but perhaps
they should be put into __gnu_cxx:: just like the concept checks. After all,
namespaces were introduced to avoid just this sort of conflict.
I looked into doing this a few months ago but got sidetracked (new job, new
baby). I'll see if I can dig up the changes, bring them up-to-date, and post
them.
__
Stephen m. Webb