summaryrefslogtreecommitdiff
path: root/fusion-utils/index_list.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'fusion-utils/index_list.hpp')
-rw-r--r--fusion-utils/index_list.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/fusion-utils/index_list.hpp b/fusion-utils/index_list.hpp
new file mode 100644
index 0000000..f363dc3
--- /dev/null
+++ b/fusion-utils/index_list.hpp
@@ -0,0 +1,16 @@
+#pragma once
+
+template<int... Indices>
+struct indices {
+ typedef indices<Indices..., sizeof...(Indices)> next;
+};
+
+template<int N>
+struct build_indices {
+ typedef typename build_indices<N - 1>::type::next type;
+};
+
+template<>
+struct build_indices<0> {
+ typedef indices<> type;
+};