aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/list/iota.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/list/iota.h b/src/list/iota.h
new file mode 100644
index 0000000..9a8d22d
--- /dev/null
+++ b/src/list/iota.h
@@ -0,0 +1,34 @@
+#ifndef TYPEASVALUE_SRC_LIST_IOTA_H_
+#define TYPEASVALUE_SRC_LIST_IOTA_H_
+
+#include "operation/math.h"
+
+namespace tav {
+
+template <
+ typename Count,
+ typename Initial,
+ typename Step
+>
+struct Iota {
+ typedef Cons<
+ Initial,
+ typename Iota<
+ Substract<Count, Size<1>>,
+ Add<Initial, Step>,
+ Step
+ >::type
+ > type;
+};
+
+template <
+ typename Initial,
+ typename Step
+>
+struct Iota<Size<1>, Initial, Step> {
+ typedef Cons<Initial, void> type;
+};
+
+}
+
+#endif // TYPEASVALUE_SRC_LIST_IOTA_H_