From 324988569183e38e9c5e42318571693a6fcd9569 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 16 Feb 2015 14:03:53 +0100 Subject: Simplified `List`, `Length` and `Reverse` implementations * continuation of 8e49cc6 * list constructor was generalized to a _variadic fold_ --- src/list/list.h | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) (limited to 'src/list/list.h') diff --git a/src/list/list.h b/src/list/list.h index c9e6a9e..1a4c260 100644 --- a/src/list/list.h +++ b/src/list/list.h @@ -2,46 +2,12 @@ #define TYPEASVALUE_SRC_LIST_LIST_H_ #include "cons.h" +#include "detail/fold_variadic.h" namespace tav { -namespace detail { - -template < - typename Head, - typename... Tail -> -struct List { - typedef Eval> - >> type; -}; - -template -struct List { - typedef Eval> type; -}; - -template -struct List { - typedef Eval> type; -}; - -template -struct List { - typedef Eval> type; -}; - -template <> -struct List { - typedef void type; -}; - -} - template -using List = Eval>; +using List = Eval>; template < typename Type, -- cgit v1.2.3