From 02c6e34f9859047efe702cf5b866702f7b02d878 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 18 Jan 2015 19:58:35 +0100 Subject: Implemented `Map` in terms of `Fold` * as its name implies this _function_ applies a given _function_ to each element of a _Cons_ structure * added appropriate test case --- src/list/operation/basic.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/list/operation/basic.h') diff --git a/src/list/operation/basic.h b/src/list/operation/basic.h index ff0a4d7..364a542 100644 --- a/src/list/operation/basic.h +++ b/src/list/operation/basic.h @@ -11,14 +11,15 @@ class Length { private: template < typename, - typename Current + typename Previous > struct Count { - typedef Add, Current> type; + typedef Add, Previous> type; }; public: typedef typename Fold, Cons>::type type; + }; template < -- cgit v1.2.3