summaryrefslogtreecommitdiff
path: root/fusion-utils
diff options
context:
space:
mode:
Diffstat (limited to 'fusion-utils')
-rw-r--r--fusion-utils/CMakeLists.txt13
-rw-r--r--fusion-utils/index_list.hpp16
2 files changed, 29 insertions, 0 deletions
diff --git a/fusion-utils/CMakeLists.txt b/fusion-utils/CMakeLists.txt
new file mode 100644
index 0000000..50e8565
--- /dev/null
+++ b/fusion-utils/CMakeLists.txt
@@ -0,0 +1,13 @@
+find_package(Boost REQUIRED)
+
+add_library(fusion-utils STATIC
+ index_list.hpp
+)
+
+target_include_directories(fusion-utils
+ PUBLIC ${Boost_INCLUDE_DIRS}
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+set_target_properties(fusion-utils PROPERTIES LINKER_LANGUAGE CXX)
+
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;
+};