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

traits.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_UNITS_TRAITS_HPP
10 #define EAGINE_UNITS_TRAITS_HPP
11 
12 #include "default.hpp"
13 
14 namespace eagine::units {
15 
16 // is_dimension
17 template <typename X>
18 struct is_dimension : std::false_type {};
19 
20 template <typename X>
21 constexpr bool is_dimension_v = is_dimension<X>::value;
22 
23 template <typename H, typename T>
24 struct is_dimension<bits::dims<H, T>> : std::true_type {};
25 
26 // is_unit
27 template <typename X>
28 struct is_unit : std::false_type {};
29 
30 template <typename D, typename S>
31 struct is_unit<unit<D, S>> : std::true_type {};
32 
33 template <typename D, typename US, typename S>
34 struct is_unit<custom_dim_unit<D, US, S>> : std::true_type {};
35 
36 // same_dimension
37 template <typename D, typename S>
38 struct same_dimension<unit<D, S>, unit<D, S>> : std::true_type {};
39 
40 template <typename D, typename US, typename S>
41 struct same_dimension<unit<D, S>, custom_dim_unit<D, US, S>>
42  : std::true_type {};
43 
44 template <typename D, typename US, typename S>
45 struct same_dimension<custom_dim_unit<D, US, S>, unit<D, S>>
46  : std::true_type {};
47 
48 template <typename D, typename US1, typename US2, typename S>
49 struct same_dimension<custom_dim_unit<D, US1, S>, custom_dim_unit<D, US2, S>>
50  : std::true_type {};
51 
52 } // namespace eagine::units
53 
54 #endif // EAGINE_UNITS_TRAITS_HPP

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