aboutsummaryrefslogtreecommitdiff
path: root/src/list/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/list/list.h')
-rw-r--r--src/list/list.h38
1 files changed, 2 insertions, 36 deletions
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<Cons<
- Head,
- Eval<List<Tail...>>
- >> type;
-};
-
-template <typename Head>
-struct List<Head> {
- typedef Eval<Cons<Head, void>> type;
-};
-
-template <typename Head>
-struct List<Head, void> {
- typedef Eval<List<Head>> type;
-};
-
-template <typename... Tail>
-struct List<void, Tail...> {
- typedef Eval<List<Tail...>> type;
-};
-
-template <>
-struct List<void, void> {
- typedef void type;
-};
-
-}
-
template <typename... Elements>
-using List = Eval<detail::List<Elements...>>;
+using List = Eval<detail::fold_variadic<Pair, Elements...>>;
template <
typename Type,