aboutsummaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
Diffstat (limited to 'src/support')
-rw-r--r--src/support/type/sequence.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/support/type/sequence.h b/src/support/type/sequence.h
new file mode 100644
index 0000000..a404e71
--- /dev/null
+++ b/src/support/type/sequence.h
@@ -0,0 +1,29 @@
+#ifndef INPUTXSLT_SRC_SUPPORT_TYPE_SEQUENCE_H_
+#define INPUTXSLT_SRC_SUPPORT_TYPE_SEQUENCE_H_
+
+#include <cstddef>
+#include <type_traits>
+
+namespace InputXSLT {
+
+template <std::size_t...>
+struct Sequence {
+ typedef Sequence type;
+};
+
+template <
+ std::size_t Size,
+ std::size_t Index = 0,
+ std::size_t... Current
+>
+struct IndexSequence {
+ typedef typename std::conditional<
+ Index < Size,
+ IndexSequence<Size, Index + 1, Current..., Index>,
+ Sequence<Current...>
+ >::type::type type;
+};
+
+}
+
+#endif // INPUTXSLT_SRC_SUPPORT_TYPE_SEQUENCE_H_