Platforms may choose whether they want 'char' to be 'signed'
or 'unsigned', so differentiating between 'unsigned char' and 'char'
is not useful. We need to differentiate between 'unsigned char' and
'signed char'.
&p = Convert<T>::to_pattern())
{
std::string str;
- if (std::is_same<T, unsigned char>() || std::is_same<T, char>())
+ if (std::is_same<T, unsigned char>() || std::is_same<T, signed char>())
str = std::to_string((int)value);
else if (std::is_same<T,bool>::value)
str = value ? "true" : "false";
else
{
std::istringstream is(s);
- if (std::is_same<T, unsigned char>::value || std::is_same<T, char>::value)
+ if (std::is_same<T, unsigned char>::value || std::is_same<T, signed char>::value)
{
int i;
is >> i;
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams