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

data.hpp
Go to the documentation of this file.
1 #ifndef EAGINE_VECT_DATA_HPP
9 #define EAGINE_VECT_DATA_HPP
10 
11 #include "data_ary.hpp"
12 #if EAGINE_USE_SIMD
13 #include "data_vec.hpp"
14 #endif
15 
16 namespace eagine::vect {
17 
18 // data
19 template <typename T, int N, bool V>
20 struct data
21  : std::conditional_t<
22  _has_vec_data<T, N>::value && V,
23  _vec_data<T, N>,
24  _ary_data<T, N>> {
25  using value_type = T;
26  static constexpr int size = N;
27 };
28 
29 // has_vect_data
30 template <typename T, int N, bool V>
31 struct has_vect_data : bool_constant<V && _has_vec_data<T, N>::value> {};
32 
33 // data_param
34 template <typename T, int N, bool V>
35 struct data_param
36  : std::conditional_t<
37  _has_vec_data<T, N>::value && V,
38  _vec_data<T, N>,
39  _ary_param<T, N>> {};
40 
41 // param
42 template <typename Data>
43 struct param;
44 
45 template <typename T, int N, bool V>
46 struct param<data<T, N, V>> : data_param<T, N, V> {};
47 
48 } // namespace eagine::vect
49 
50 #endif // EAGINE_VECT_DATA_HPP
value_type
Value tree value element data type enumeration.
Definition: interface.hpp:27
std::integral_constant< bool, B > bool_constant
Alias for boolean constant type.
Definition: int_constant.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).