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/list.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/list/list.h') diff --git a/src/list/list.h b/src/list/list.h index 66394fc..2e335e2 100644 --- a/src/list/list.h +++ b/src/list/list.h @@ -10,15 +10,15 @@ template < typename... Tail > struct List { - typedef Cons< + typedef typename Cons< Head, typename List::type - > type; + >::type type; }; template struct List { - typedef Cons type; + typedef typename Cons::type type; }; template < @@ -30,10 +30,10 @@ using ListOfType = List< >; template -using Head = Car; +using Head = typename Car::type; template -using Tail = Cdr; +using Tail = typename Cdr::type; } -- cgit v1.2.3