From f922e0b5dfc0a03378b231ad2705dbef29310d56 Mon Sep 17 00:00:00 2001
From: Adrian Kummerlaender
Date: Fri, 16 Jan 2015 23:55:01 +0100
Subject: Implemented recursive `Concatenate` _Cons_ constructor * concatenates
 two given _Cons_ based lists into a single one

---
 src/list/list.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

(limited to 'src/list')

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_
-- 
cgit v1.2.3