OGLplus  (0.59.0) a C++ wrapper for rendering APIs

mp_arithmetic.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_MP_ARITHMETIC_HPP
10 #define EAGINE_MP_ARITHMETIC_HPP
11 
12 #include <type_traits>
13 
14 namespace eagine {
15 
19 template <typename T1, typename T2>
20 struct mp_plus;
21 
25 template <typename T1, typename T2>
27 
31 template <typename T1, typename T2>
33 
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> {};
37 
41 template <typename T1, typename T2>
42 struct mp_minus;
43 
47 template <typename T1, typename T2>
49 
53 template <typename T1, typename T2>
55 
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> {};
59 
63 template <typename T1>
64 struct mp_negate;
65 
69 template <typename T1>
71 
75 template <typename T1>
77 
78 template <typename Int, Int I1>
79 struct mp_negate<std::integral_constant<Int, I1>>
80  : std::integral_constant<Int, -I1> {};
81 
82 } // namespace eagine
83 
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
constexpr auto mp_negate_v
Unary negation operation on types representing numbers.
Definition: mp_arithmetic.hpp:76
typename mp_plus< T1, T2 >::type mp_plus_t
Addition operation on types representing numbers.
Definition: mp_arithmetic.hpp:26
constexpr auto mp_plus_v
Addition operation on types representing numbers.
Definition: mp_arithmetic.hpp:32
typename mp_negate< T1 >::type mp_negate_t
Unary negation operation on types representing numbers.
Definition: mp_arithmetic.hpp:70
constexpr auto mp_minus_v
Subtraction operation on types representing numbers.
Definition: mp_arithmetic.hpp:54
typename mp_minus< T1, T2 >::type mp_minus_t
Subtraction operation on types representing numbers.
Definition: mp_arithmetic.hpp:48
Implementation of negation on types representing numbers.
Definition: mp_arithmetic.hpp:64
Implementation of addition on types representing numbers.
Definition: mp_arithmetic.hpp:20

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).