[PPL-devel] [GIT] ppl/ppl(master): Specialize C_Integer<T> for plain char.

Roberto Bagnara bagnara at cs.unipr.it
Mon Feb 14 11:05:10 CET 2011


Module: ppl/ppl
Branch: master
Commit: 8b29e34e75e9ee93899a9f3f8311142398517c0e
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=8b29e34e75e9ee93899a9f3f8311142398517c0e

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Thu Feb  3 07:48:15 2011 +0100

Specialize C_Integer<T> for plain char.

---

 src/C_Integer.hh |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/C_Integer.hh b/src/C_Integer.hh
index 8557a6b..c08156a 100644
--- a/src/C_Integer.hh
+++ b/src/C_Integer.hh
@@ -62,6 +62,27 @@ template <typename T>
 struct C_Integer : public False { };
 
 template <>
+struct C_Integer<char> : public True {
+  enum anonymous_enum {
+#if PPL_CXX_PLAIN_CHAR_IS_SIGNED
+    is_signed = true
+#else
+    is_signed = false
+#endif
+  };
+  typedef void smaller_type;
+  typedef void smaller_signed_type;
+  typedef void smaller_unsigned_type;
+#if PPL_CXX_PLAIN_CHAR_IS_SIGNED
+  typedef unsigned char other_type;
+#else
+  typedef signed char other_type;
+#endif
+  static const char min = CHAR_MIN;
+  static const char max = CHAR_MAX;
+};
+
+template <>
 struct C_Integer<signed char> : public True {
   enum anonymous_enum { is_signed = true };
   typedef void smaller_type;




More information about the PPL-devel mailing list