From e176dbe160eff01d172a11e7a191f756d4c87712 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 30 Jan 2015 19:07:22 +0100 Subject: Separated `Map` and `Filter` * there is no reason to keep them in the same header --- src/list/operation/higher/map.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/list/operation/higher/map.h (limited to 'src/list/operation/higher/map.h') diff --git a/src/list/operation/higher/map.h b/src/list/operation/higher/map.h new file mode 100644 index 0000000..1c577ca --- /dev/null +++ b/src/list/operation/higher/map.h @@ -0,0 +1,33 @@ +#ifndef TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_MAP_H_ +#define TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_MAP_H_ + +#include "fold.h" +#include "conditional/if.h" + +namespace tav { + +template < + template class Function, + typename List +> +class Map { + private: + template < + typename Current, + typename Previous + > + struct function_wrapper { + typedef Cons< + typename Function::type, + Previous + > type; + }; + + public: + typedef typename Fold::type type; + +}; + +} + +#endif // TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_MAP_H_ -- cgit v1.2.3