Question/problem related to _Bool in type_traits.h

Stephen M. Webb stephen@bregmasoft.com
Tue Oct 16 06:27:00 GMT 2001


On Tue, 16 Oct 2001, Carlo Wood wrote:
> Why not removing the '#define _Bool   bool' from 3.0's stdbool.h?
> I don't think people should use _Bool in user applications when
> compiling C++ programs with 3.x?  They should use 'bool' that is
> the whole point of stdbool.h, so you can use 'bool' regardless.

The C++ standard library should not be introducing names into the global
namespace.  I would consider that an implementation flaw.

Granted, the name '_Bool' is in the name space (not namespace) reseved
for the implementation, so removing it from stdbool.h should also fix the
symptom, but I would consider backward compatibility with existing software,
both that which uses stdbool.h and that which uses other nonconfirming _Bool
definitions.

I think moving the type_traits names, all of them, into __gcc_cxx:: is worth
doing regardless.

__
Stephen M. Webb



More information about the Libstdc++ mailing list