|
21 | 21 | #define INDEX_H |
22 | 22 |
|
23 | 23 | #include "memilio/utils/compiler_diagnostics.h" |
24 | | -#include "memilio/utils/metaprogramming.h" |
25 | 24 | #include "memilio/utils/type_safe.h" |
26 | | -#include <tuple> |
27 | | -#include <type_traits> |
28 | | -#include <utility> |
29 | 25 |
|
30 | 26 | namespace mio |
31 | 27 | { |
32 | 28 |
|
33 | 29 | template <typename... CategoryTags> |
34 | 30 | class Index; |
35 | 31 |
|
36 | | -namespace details |
37 | | -{ |
38 | | - |
39 | | -template <class... Tags> |
40 | | -std::tuple<Index<Tags>...> get_tuple(Index<Tags...> i) |
41 | | -{ |
42 | | - if constexpr (sizeof...(Tags) == 1) { |
43 | | - return std::tuple(i); |
44 | | - } |
45 | | - else { |
46 | | - return i.indices; |
47 | | - } |
48 | | -} |
49 | | - |
50 | | -template <class Enum> |
51 | | -std::tuple<Index<Enum>> get_tuple(Enum i) |
52 | | - requires std::is_enum<Enum>::value |
53 | | -{ |
54 | | - return std::tuple(Index<Enum>(i)); |
55 | | -} |
56 | | - |
57 | | -// template <class... Tags> |
58 | | -// Index<Tags...> merge_index_from_tuple(std::tuple<Index<Tags>...>); |
59 | | - |
60 | | -template <class... IndexArgs> |
61 | | -auto merge_indices(IndexArgs... args) |
62 | | -{ |
63 | | - return std::tuple_cat(get_tuple(args)...); |
64 | | -} |
65 | | - |
66 | | -template <class... IndexArgs> |
67 | | -using merge_indices_expr = decltype(std::tuple(get_tuple(std::declval<IndexArgs>())...)); |
68 | | - |
69 | | -} // namespace details |
70 | | - |
71 | 32 | /** |
72 | 33 | * @brief An Index with a single template parameter is a typesafe wrapper for size_t |
73 | 34 | * that is associated with a Tag. It is used to index into a CustomIndexArray |
@@ -178,13 +139,6 @@ class Index |
178 | 139 | } |
179 | 140 |
|
180 | 141 | public: |
181 | | - template <class... IndexArgs, |
182 | | - class = std::enable_if_t<is_expression_valid<details::merge_indices_expr, IndexArgs...>::value>> |
183 | | - Index(IndexArgs... _index_args) |
184 | | - : indices(details::merge_indices(_index_args...)) |
185 | | - { |
186 | | - } |
187 | | - |
188 | 142 | // comparison operators |
189 | 143 | bool operator==(Index const& other) const |
190 | 144 | { |
|
0 commit comments