aboutsummaryrefslogtreecommitdiff
path: root/src/list
diff options
context:
space:
mode:
Diffstat (limited to 'src/list')
-rw-r--r--src/list/list.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/list/list.h b/src/list/list.h
index edd46e8..f21d0fc 100644
--- a/src/list/list.h
+++ b/src/list/list.h
@@ -27,6 +27,16 @@ using Head = Car<Cons>;
template <typename Cons>
using Tail = Cdr<Cons>;
+template <typename Cons>
+struct Length {
+ typedef Add<Size<1>, typename Length<Cdr<Cons>>::type> type;
+};
+
+template <>
+struct Length<void> {
+ typedef Size<0> type;
+};
+
template <
typename Primary,
typename Secondary