Why this (char is signed on my implementation):
cout << std::is_same< char,signed char>::value;
outputs false?
The three types were introduced at different times.
From the C99 Rational:
Three types of
charare specified:
signed, plain, andunsigned. A plaincharmay be represented as either signed or unsigned depending upon the implementation, as in prior practice. The typesigned charwas introduced in C89 to make available a one-byte signed integer type on those systems which implement plaincharasunsigned char.
They have to stay separate types in C++, to allow overloading on char to be portable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With