There is no concept of signedness for bool
. From [basic.fundamental]/6:
Values of type
bool
are eithertrue
offalse
. [Note: There are nosigned
,unsigned
,short
, orlong
bool
types or values. — end note] Values of typebool
participate in integral promotions (4.5).
By contrast, signedness is explicitly called out for the signed integer types (paragraph 2) and unsigned integer types (paragraph 3).
Now for the is_signed
and is_unsigned
traits. First off, the traits are always well-defined, but only interesting for arithmetic types. bool
is an arithmetic type, and is_signed<T>::value
is defined (see Table 49) as T(-1) < T(0)
. By using the rules of boolean conversion and standard arithmetic conversions, we see that this is is false
for T = bool
(because bool(-1)
is true
, which converts to 1
). Similarly, is_unsigned<T>::value
is defined as T(0) < T(-1)
, which is true
for T = bool
.