diff options
Diffstat (limited to 'src/list/generator/iota.h')
-rw-r--r-- | src/list/generator/iota.h | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/src/list/generator/iota.h b/src/list/generator/iota.h index 73b7cc8..1def67e 100644 --- a/src/list/generator/iota.h +++ b/src/list/generator/iota.h @@ -1,44 +1,24 @@ #ifndef TYPEASVALUE_SRC_LIST_GENERATOR_IOTA_H_ #define TYPEASVALUE_SRC_LIST_GENERATOR_IOTA_H_ +#include "pair.h" #include "operation/math.h" +#include "function/apply.h" +#include "detail/generate_nested_structure.h" namespace tav { -namespace detail { - -template < - typename Count, - typename Initial, - typename Step -> -struct Iota { - typedef Cons< - Initial, - Eval<Iota< - Substract<Count, Size<1>>, - Add<Initial, Step>, - Step - >> - > type; -}; - -template < - typename Initial, - typename Step -> -struct Iota<Size<1>, Initial, Step> { - typedef Cons<Initial, void> type; -}; - -} - template < typename Count, typename Initial, typename Step > -using Iota = Eval<detail::Iota<Count, Initial, Step>>; +using Iota = Eval<detail::generate_nested_structure< + Pair, + Apply<Add, Step, _0>::template function, + Initial, + Count +>>; } |