9 #ifndef EAGINE_UNITS_FWD_HPP
10 #define EAGINE_UNITS_FWD_HPP
12 #include "../int_constant.hpp"
13 #include "../nothing.hpp"
15 namespace eagine::units {
18 template <
typename Head,
typename Tail>
21 template <
typename Dim,
int Pow>
24 template <
typename Head,
typename Tail>
27 template <
typename Unit,
typename Scale>
34 template <
typename Derived>
37 template <
typename Dimension,
typename Derived>
40 template <
typename Scale,
typename Unit>
47 template <
typename System>
50 template <
typename BaseDim,
int Pow>
51 using dimension = bits::dims<bits::dim_pow<BaseDim, Pow>, nothing_t>;
53 template <
typename Dims,
typename System>
56 template <
typename Dims,
typename Scales,
typename System>
57 struct custom_dim_unit;
59 template <
typename Dims,
typename Scales,
typename System>
60 struct scaled_dim_unit_conv;
62 template <
typename Dims,
typename Scales,
typename System>
63 using scaled_dim_unit =
64 custom_dim_unit<Dims, scaled_dim_unit_conv<Dims, Scales, System>, System>;
66 template <
typename UnitFrom,
typename UnitTo>
69 template <
typename U1>
72 template <
typename U1>
73 using lit_result_t =
typename lit_result<U1>::type;
75 template <
typename U1,
typename U2>
78 template <
typename U1,
typename U2>
79 using add_result_t =
typename add_result<U1, U2>::type;
81 template <
typename U1,
typename U2>
84 template <
typename U1,
typename U2>
85 using sub_result_t =
typename sub_result<U1, U2>::type;
87 template <
typename U1,
typename U2>
90 template <
typename U1,
typename U2>
91 using mul_l_operand_t =
typename mul_l_operand<U1, U2>::type;
93 template <
typename U1,
typename U2>
96 template <
typename U1,
typename U2>
97 using mul_r_operand_t =
typename mul_r_operand<U1, U2>::type;
99 template <
typename U1,
typename U2>
102 template <
typename U1,
typename U2>
103 using mul_result_t =
typename mul_result<U1, U2>::type;
105 template <
typename U1,
typename U2>
106 struct div_l_operand : mul_l_operand<U1, U2> {};
108 template <
typename U1,
typename U2>
109 using div_l_operand_t =
typename div_l_operand<U1, U2>::type;
111 template <
typename U1,
typename U2>
112 struct div_r_operand : mul_r_operand<U1, U2> {};
114 template <
typename U1,
typename U2>
115 using div_r_operand_t =
typename div_r_operand<U1, U2>::type;
117 template <
typename U1,
typename U2>
120 template <
typename U1,
typename U2>
121 using div_result_t =
typename div_result<U1, U2>::type;
123 template <
typename X>
124 struct dimension_of : X::dimension {};
127 struct dimension_of<nothing_t> : nothing_t {};
129 template <
typename X>
130 using dimension_of_t =
typename dimension_of<X>::type;
132 template <
typename X,
typename Y>
133 struct same_dimension;
135 template <
typename X,
typename Y>
136 constexpr
bool same_dimension_v = same_dimension<X, Y>::value;
138 template <
typename X>
141 template <
typename X>
142 constexpr
bool is_unit_v = is_unit<X>::value;
144 template <
typename U1,
typename U2>
145 struct is_convertible;
147 template <
typename U1,
typename U2>
148 constexpr
bool is_convertible_v = is_convertible<U1, U2>::value;
150 template <
typename Item>
152 static constexpr nothing_t mp_str{};
155 template <
typename Item>
157 static constexpr nothing_t mp_str{};
162 #endif // EAGINE_UNITS_FWD_HPP