Using the bool Type

Enable the Enable bool Support setting to use the standard C++ bool type to represent true and false. Disable this setting if recognizing bool, true, or false as keywords causes problems in your program.

Enabling the bool data type and its true and false values is not equivalent to defining them using typedef and #define. The C++ bool type is a distinct type defined by the ISO C++ Standard. Source code that does not treat it as a distinct type might not compile properly.

For example, some compilers equate the bool type with the unsigned char data type. If you disable the Enable bool Support setting, the Carbide.c++ compiler equates the bool type with the unsigned char data type. Otherwise, using the Carbide C/C++ compiler on source code that involves this behavior might result in errors.

This setting corresponds to the pragma bool. To check this setting, use __option (bool). By default, this setting is disabled.

See Checking Option Settings for information on how to use this directive.