diff options
Diffstat (limited to 'src/list/generator/iota.h')
-rw-r--r-- | src/list/generator/iota.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/list/generator/iota.h b/src/list/generator/iota.h index 56ebeca..73b7cc8 100644 --- a/src/list/generator/iota.h +++ b/src/list/generator/iota.h @@ -5,20 +5,22 @@ namespace tav { +namespace detail { + template < typename Count, typename Initial, typename Step > struct Iota { - typedef Eval<Cons< + typedef Cons< Initial, Eval<Iota< Substract<Count, Size<1>>, Add<Initial, Step>, Step >> - >> type; + > type; }; template < @@ -26,9 +28,18 @@ template < typename Step > struct Iota<Size<1>, Initial, Step> { - typedef Eval<Cons<Initial, void>> type; + typedef Cons<Initial, void> type; }; } +template < + typename Count, + typename Initial, + typename Step +> +using Iota = Eval<detail::Iota<Count, Initial, Step>>; + +} + #endif // TYPEASVALUE_SRC_LIST_GENERATOR_IOTA_H_ |