I'm using the fixed width integer types std::int8_t
and std::uint8_t
which are included in C++ since C++11 (header <cstdint>
). I use the gcc compiler for c++ programming (Linux, gcc --version 4.8.2).
On my machine the lines
#include <cstdint>
#include <type_traits>
//...
std::cout << std::is_same<std::uint8_t,unsigned char>::value << std::endl;
std::cout << std::is_same<std::int8_t,char>::value << std::endl;
give the output
1
0
In other words: std::uint8_t
is implemented as unsigned char
but std::int8_t
is not implemented as char
! I have no (reasonable) idea how it could be that std::int8_t
is not implemented as char
. Question: How can this result be interpreted?