diff options
author | Adrian Kummerlaender | 2015-02-06 19:26:26 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2015-02-06 19:26:26 +0100 |
commit | 27aaee43499c268903332c7e9e1e6ec2d193dc3a (patch) | |
tree | fcd6a361aa5ce6a9c095f496886807f87af85ea0 /src/list/list.h | |
parent | 1e0528b1a870e0e0f2b15f468fc60f80e5fc20b3 (diff) | |
download | TypeAsValue-27aaee43499c268903332c7e9e1e6ec2d193dc3a.tar TypeAsValue-27aaee43499c268903332c7e9e1e6ec2d193dc3a.tar.gz TypeAsValue-27aaee43499c268903332c7e9e1e6ec2d193dc3a.tar.bz2 TypeAsValue-27aaee43499c268903332c7e9e1e6ec2d193dc3a.tar.lz TypeAsValue-27aaee43499c268903332c7e9e1e6ec2d193dc3a.tar.xz TypeAsValue-27aaee43499c268903332c7e9e1e6ec2d193dc3a.tar.zst TypeAsValue-27aaee43499c268903332c7e9e1e6ec2d193dc3a.zip |
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
Diffstat (limited to 'src/list/list.h')
-rw-r--r-- | src/list/list.h | 10 |
1 files changed, 5 insertions, 5 deletions
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<Tail...>::type - > type; + >::type type; }; template <typename Head> struct List<Head> { - typedef Cons<Head, void> type; + typedef typename Cons<Head, void>::type type; }; template < @@ -30,10 +30,10 @@ using ListOfType = List< >; template <typename Cons> -using Head = Car<Cons>; +using Head = typename Car<Cons>::type; template <typename Cons> -using Tail = Cdr<Cons>; +using Tail = typename Cdr<Cons>::type; } |