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

dimension.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_UNITS_DIMENSION_HPP
10 #define EAGINE_UNITS_DIMENSION_HPP
11 
12 #include "base_dim.hpp"
13 #include "detail.hpp"
14 #include "traits.hpp"
15 
16 namespace eagine::units {
17 
18 // multiplication
19 template <typename D1, typename D2>
20 static inline auto operator*(D1, D2) noexcept -> std::enable_if_t<
21  is_dimension_v<D1> && is_dimension_v<D2>,
22  bits::dim_add_t<D1, D2>> {
23  return {};
24 }
25 
26 // division
27 template <typename D1, typename D2>
28 static inline auto operator/(D1, D2) noexcept -> std::enable_if_t<
29  is_dimension_v<D1> && is_dimension_v<D2>,
30  bits::dim_sub_t<D1, D2>> {
31  return {};
32 }
33 
34 // base_dimension_power
35 template <typename Dim, typename BaseDim>
36 using base_dimension_power = bits::get_pow<Dim, BaseDim>;
37 
38 // basic dimensions
39 using angle = dimension<base::angle, 1>;
40 using solid_angle = dimension<base::solid_angle, 1>;
41 
42 using length = dimension<base::length, 1>;
43 using mass = dimension<base::mass, 1>;
44 using time = dimension<base::time, 1>;
45 
46 using temperature = dimension<base::temperature, 1>;
47 using electric_current = dimension<base::electric_current, 1>;
48 using number_of_cycles = dimension<base::number_of_cycles, 1>;
49 using number_of_decays = dimension<base::number_of_decays, 1>;
50 using luminous_intensity = dimension<base::luminous_intensity, 1>;
51 using amount_of_substance = dimension<base::amount_of_substance, 1>;
52 using amount_of_information = dimension<base::amount_of_information, 1>;
53 
54 } // namespace eagine::units
55 
56 #endif // EAGINE_UNITS_DIMENSION_HPP

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