]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Explicitly list signed/unsigned char. 5895/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 13 Feb 2018 21:57:31 +0000 (14:57 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 13 Feb 2018 23:37:00 +0000 (16:37 -0700)
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'.

include/deal.II/base/patterns.h

index 03d1d1a3578843587556c35e11dcb612f4b6aad1..f8fea8f4feb1f3ffbd7d6c5f33ef0cbec08b648b 100644 (file)
@@ -1390,7 +1390,7 @@ namespace Patterns
                                    &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";
@@ -1411,7 +1411,7 @@ namespace Patterns
         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


Typeset in Trocchi and Trocchi Bold Sans Serif.