[PPL-devel] [GIT] ppl/ppl(ppl-0_11-branch): Specialize C_Integer<T> for plain char.
Roberto Bagnara
bagnara at cs.unipr.it
Thu Feb 3 07:53:07 CET 2011
Module: ppl/ppl
Branch: ppl-0_11-branch
Commit: 4771be9cdede70e06083ed22be72624063548c80
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=4771be9cdede70e06083ed22be72624063548c80
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