Determine if T is an unsigned or signed integral type.
This works as follows:
- If T is signed then -1 in that type is always less than 0 in that type
- If T is unsigned then conversion of -1 to that type gives the maximally encodable value for that type. This is always greater than 0 in that type,
- If T is
_Bool
or equivalent, -1 converted to it results in 1 and 0 is also mapped to 0. Thus it is detected as unsigned.
- See also
- P99_SIGNED for a similar macro that takes an expression as an argument
Definition at line 423 of file p99_int.h.