Go to the documentation of this file.
9 #ifndef EAGINE_MP_ARITHMETIC_HPP
10 #define EAGINE_MP_ARITHMETIC_HPP
12 #include <type_traits>
19 template <
typename T1,
typename T2>
25 template <
typename T1,
typename T2>
31 template <
typename T1,
typename T2>
34 template <
typename Int, Int I1, Int I2>
35 struct mp_plus<std::integral_constant<Int, I1>, std::integral_constant<Int, I2>>
36 : std::integral_constant<Int, I1 + I2> {};
41 template <
typename T1,
typename T2>
47 template <
typename T1,
typename T2>
53 template <
typename T1,
typename T2>
56 template <
typename Int, Int I1, Int I2>
57 struct mp_minus<std::integral_constant<Int, I1>, std::integral_constant<Int, I2>>
58 : std::integral_constant<Int, I1 - I2> {};
63 template <
typename T1>
69 template <
typename T1>
75 template <
typename T1>
78 template <
typename Int, Int I1>
79 struct mp_negate<std::integral_constant<Int, I1>>
80 : std::integral_constant<Int, -I1> {};
84 #endif // EAGINE_MP_ARITHMETIC_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21
Implementation of subtraction on types representing numbers.
Definition: mp_arithmetic.hpp:42
Implementation of negation on types representing numbers.
Definition: mp_arithmetic.hpp:64
Implementation of addition on types representing numbers.
Definition: mp_arithmetic.hpp:20