26 #ifndef MLN_VALUE_BUILTIN_INTEGERS_HH
27 # define MLN_VALUE_BUILTIN_INTEGERS_HH
33 # include <mln/value/internal/limits.hh>
35 # include <mln/value/concept/built_in.hh>
36 # include <mln/value/concept/integer.hh>
37 # include <mln/trait/value_.hh>
39 # include <mln/metal/int.hh>
40 # include <mln/metal/if.hh>
41 # include <mln/metal/bool.hh>
47 template <>
struct category< unsigned char > {
typedef value::Built_In< value::Integer<void> > ret; };
48 template <>
struct category< signed char > {
typedef value::Built_In< value::Integer<void> > ret; };
49 template <>
struct category< unsigned short > {
typedef value::Built_In< value::Integer<void> > ret; };
50 template <>
struct category< signed short > {
typedef value::Built_In< value::Integer<void> > ret; };
51 template <>
struct category< unsigned int > {
typedef value::Built_In< value::Integer<void> > ret; };
52 template <>
struct category< signed int > {
typedef value::Built_In< value::Integer<void> > ret; };
53 template <>
struct category< unsigned long > {
typedef value::Built_In< value::Integer<void> > ret; };
54 template <>
struct category< signed long > {
typedef value::Built_In< value::Integer<void> > ret; };
69 enum { n = 8 *
sizeof(E) };
75 card = mln_value_card_from_(n)
78 typedef trait::value::nature::integer nature;
79 typedef trait::value::kind::data kind;
80 typedef mln_value_quant_from_(card) quant;
82 static const E min() {
return mln::value::internal::limits<E>::min(); }
83 static const E
max() {
return mln::value::internal::limits<E>::max(); }
91 template <>
struct value_< unsigned char >
92 : internal::value_integer_< unsigned char >
94 static const char* name()
95 {
return "unsigned char"; }
98 template <>
struct value_< signed char >
99 : internal::value_integer_< signed char >
101 static const char* name()
102 {
return "signed char"; }
105 template <>
struct value_< char >
106 : internal::value_integer_< signed char >
108 static const char* name()
112 template <>
struct value_< unsigned short >
113 : internal::value_integer_< unsigned short >
115 static const char* name()
116 {
return "unsigned short"; }
119 template <>
struct value_< signed short >
120 : internal::value_integer_< signed short >
122 static const char* name()
123 {
return "signed short"; }
126 template <>
struct value_< unsigned int >
127 : internal::value_integer_< unsigned int >
129 static const char* name()
130 {
return "unsigned int"; }
133 template <>
struct value_< signed int >
134 : internal::value_integer_< signed int >
136 static const char* name()
137 {
return "signed int"; }
140 template <>
struct value_< unsigned long >
141 : internal::value_integer_< unsigned long >
143 static const char* name()
144 {
return "unsigned long"; }
147 template <>
struct value_< signed long >
148 : internal::value_integer_< signed long >
150 static const char* name()
151 {
return "signed long"; }
159 #endif // ! MLN_VALUE_BUILTIN_INTEGERS_HH