diff options
Diffstat (limited to 'src/list')
-rw-r--r-- | src/list/list.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/list/list.h b/src/list/list.h index 47d0d2f..edd46e8 100644 --- a/src/list/list.h +++ b/src/list/list.h @@ -21,6 +21,31 @@ struct List<Head> { typedef Cons<Head, void> type; }; +template <typename Cons> +using Head = Car<Cons>; + +template <typename Cons> +using Tail = Cdr<Cons>; + +template < + typename Primary, + typename Secondary +> +struct Concatenate { + typedef Cons< + Head<Primary>, + typename Concatenate< + Tail<Primary>, + Secondary + >::type + > type; +}; + +template <typename Secondary> +struct Concatenate<void, Secondary> { + typedef Secondary type; +}; + } #endif // TYPEASVALUE_SRC_LIST_LIST_H_ |