J
James Kuyper
On 01/27/2012 06:19 PM, Stephen Sprunk wrote:
....
The behavior of _Bool is different from any other unsigned integer type
in two ways:
* It has an integer conversion rank lower than any other standard
integer type.
* (_Bool)expression is equivalent to ((expression) != 0).
....
I'm not sure why "bool" isn't simply a typedef to some existing integer
type, which was common practice prior to _Bool being added to the
language. Perhaps knowing a variable is boolean allows compilers to
make more aggressive optimizations that would be unsafe for other
integer types.
The behavior of _Bool is different from any other unsigned integer type
in two ways:
* It has an integer conversion rank lower than any other standard
integer type.
* (_Bool)expression is equivalent to ((expression) != 0).