November 1999
Intermediate to advanced
240 pages
5h 22m
English
Difficulty: 7
Do we really need a builtin bool type? Why not just emulate it in the existing language? This Item reveals the answer.
Besides wchar_t (which was a typedef in C), bool is the only builtin type to be added to C++ since the ARM (Ellis90).
Could bool's effect have been duplicated without adding a builtin type? If yes, show an equivalent implementation. If no, show why possible implementations do not behave the same as the builtin bool.
The answer is: No, bool's effect could not have been duplicated without adding a builtin type. The bool builtin type, and the reserved keywords true and false, were added to C++ precisely ...
Read now
Unlock full access