12 #ifndef BOOST_MPL11_INTEGER_HPP
13 #define BOOST_MPL11_INTEGER_HPP
29 namespace boost {
namespace mpl11 {
30 template <
typename T, T ...v>
31 struct or_<integer_c<T, v>...>
32 : detail::logical_or::strict<bool_<(bool)v>...>
35 template <
typename T, T ...v>
36 struct and_<integer_c<T, v>...>
37 : bool_<!detail::logical_or::strict<bool_<!v>...>::value>
42 struct Monoid<Integer> : instantiate<Monoid>::with<Integer> {
43 template <
typename x,
typename y>
44 using plus_impl = integer_c<
45 decltype(x::value + y::value),
49 template <
typename ...>
50 using zero_impl = int_<0>;
54 struct Group<Integer> : instantiate<Group>::with<Integer> {
55 template <
typename x,
typename y>
56 using minus_impl = integer_c<
57 decltype(x::value - y::value),
62 using negate_impl = integer_c<
69 struct Ring<Integer> : instantiate<Ring>::with<Integer> {
70 template <
typename x,
typename y>
71 using mult_impl = integer_c<
72 decltype(x::value * y::value),
76 template <
typename ...>
77 using one_impl = int_<1>;
81 struct IntegralDomain<Integer>
82 : instantiate<IntegralDomain>::with<Integer>
84 template <
typename x,
typename y>
85 using div_impl = integer_c<
86 decltype(x::value / y::value),
90 template <
typename x,
typename y>
91 using mod_impl = integer_c<
92 decltype(x::value % y::value),
98 struct Enumerable<Integer> : instantiate<Enumerable>::with<Integer> {
100 using succ_impl = integer_c<
101 decltype(x::value + 1),
105 template <
typename x>
106 using pred_impl = integer_c<
107 decltype(x::value - 1),
113 struct Comparable<Integer> : instantiate<Comparable>::with<Integer> {
114 template <
typename x,
typename y>
115 using equal_impl = bool_<x::value == y::value>;
117 template <
typename x,
typename y>
118 using not_equal_impl = bool_<x::value != y::value>;
122 struct Orderable<Integer> : instantiate<Orderable>::with<Integer> {
123 template <
typename x,
typename y>
124 using less_impl = bool_<(x::value < y::value)>;
126 template <
typename x,
typename y>
127 using less_equal_impl = bool_<(x::value <= y::value)>;
129 template <
typename x,
typename y>
130 using greater_impl = bool_<(x::value > y::value)>;
132 template <
typename x,
typename y>
133 using greater_equal_impl = bool_<(x::value >= y::value)>;
135 template <
typename x,
typename y>
136 using max_impl = if_c<(x::value < y::value), y, x>;
138 template <
typename x,
typename y>
139 using min_impl = if_c<(x::value < y::value), x, y>;
143 struct Bitwise<Integer> : instantiate<Bitwise>::with<Integer> {
144 template <
typename x,
typename y>
145 using bitand_impl = integer_c<
146 decltype(x::value & y::value),
150 template <
typename x,
typename y>
151 using bitor_impl = integer_c<
152 decltype(x::value | y::value),
156 template <
typename x,
typename y>
157 using bitxor_impl = integer_c<
158 decltype(x::value ^ y::value),
162 template <
typename x,
typename n>
163 using shift_left_impl = integer_c<
164 decltype(x::value << n::value),
165 (x::value << n::value)
168 template <
typename x,
typename n>
169 using shift_right_impl = integer_c<
170 decltype(x::value >> n::value),
171 (x::value >> n::value)
174 template <
typename x>
175 using compl_impl = integer_c<
182 #endif // !BOOST_MPL11_INTEGER_HPP
Forward declares the Integer datatype.
Defines the Ring typeclass.
Defines the Comparable typeclass.
Defines the methods of the Enumerable typeclass.
Defines the Integral Domain typeclass.
Defines the Logical module.
Defines boost::mpl11::detail::logical_or::strict.
Defines the Bitwise typeclass.
Defines the Group typeclass.
Defines the Orderable typeclass.
Defines the Monoid typeclass.