Morpheus 1.0.0
Dynamic matrix type and algorithms for sparse matrices
Loading...
Searching...
No Matches
Morpheus_Metaprogramming.hpp
1
24#ifndef MORPHEUS_METAPROGRAMMING_HPP
25#define MORPHEUS_METAPROGRAMMING_HPP
26
27#include <impl/Morpheus_Metaprogramming.hpp>
28
29#include <tuple>
30
31namespace Morpheus {
32
46template <typename... Ts>
47struct TypeList {
48 using type = TypeList<Ts...>;
49};
50
56template <typename... Ts>
57struct Set {
58 using type = Set<Ts...>;
59};
60
66template <class... Ts>
68 template <std::size_t N>
69 using type = typename std::tuple_element<N, std::tuple<Ts...>>::type;
70};
71
76template <typename... Head_>
77struct TypeList<Set<Head_...>> {
78 using Head = Set<Head_...>;
79 using Tail = void;
80};
90template <typename... Head_, typename... Tail_>
91struct TypeList<Set<Head_...>, Tail_...> {
92 using Head = Set<Head_...>;
93 using Tail = TypeList<Tail_...>;
94};
95
121template <typename... Ts, typename... Us>
122struct concat<TypeList<Ts...>, TypeList<Us...>> {
123 using type = typename Impl::concat<TypeList<Ts...>, TypeList<Us...>>::type;
124};
125
151template <typename... Ts, typename... Us>
152struct cross_product<TypeList<Ts...>, TypeList<Us...>> {
153 using type =
154 typename Impl::cross_product<TypeList<Ts...>, TypeList<Us...>>::type;
155};
158} // namespace Morpheus
159
160#endif // MORPHEUS_METAPROGRAMMING_HPP
Generic Morpheus interfaces.
Definition: dummy.cpp:24
Compile-time type list with indexed access.
Definition: Morpheus_Metaprogramming.hpp:67
Compile-time set.
Definition: Morpheus_Metaprogramming.hpp:57
Compile-time type list.
Definition: Morpheus_Metaprogramming.hpp:47