diff options
Diffstat (limited to 'src/list/operation/higher/map.h')
-rw-r--r-- | src/list/operation/higher/map.h | 33 |
1 files changed, 33 insertions, 0 deletions
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<typename> class Function, + typename List +> +class Map { + private: + template < + typename Current, + typename Previous + > + struct function_wrapper { + typedef Cons< + typename Function<Current>::type, + Previous + > type; + }; + + public: + typedef typename Fold<function_wrapper, void, List>::type type; + +}; + +} + +#endif // TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_MAP_H_ |