From 27aaee43499c268903332c7e9e1e6ec2d193dc3a Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 6 Feb 2015 19:26:26 +0100 Subject: Revamped to use `Cons` as a function and `Pair` as its result * this is analogous to _Scheme_ where a pair (dot-expression) is returned from a call to `cons` * `Head` and `Tail` are kept as direct references to the `CAR` and `CDR` values of a pair to match e.g. the math operators --- src/list/generator/iota.h | 6 +++--- src/list/generator/make_list.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/list/generator') diff --git a/src/list/generator/iota.h b/src/list/generator/iota.h index 54f0f40..2d5b506 100644 --- a/src/list/generator/iota.h +++ b/src/list/generator/iota.h @@ -11,14 +11,14 @@ template < typename Step > struct Iota { - typedef Cons< + typedef typename Cons< Initial, typename Iota< Substract>, Add, Step >::type - > type; + >::type type; }; template < @@ -26,7 +26,7 @@ template < typename Step > struct Iota, Initial, Step> { - typedef Cons type; + typedef typename Cons::type type; }; } diff --git a/src/list/generator/make_list.h b/src/list/generator/make_list.h index 3bf65a2..33419cb 100644 --- a/src/list/generator/make_list.h +++ b/src/list/generator/make_list.h @@ -11,18 +11,18 @@ template < typename Element > struct MakeList { - typedef Cons< + typedef typename Cons< Element, typename MakeList< Substract>, Element >::type - > type; + >::type type; }; template struct MakeList, Element> { - typedef Cons type; + typedef typename Cons::type type; }; } -- cgit v1.2.3