From 868f7d2c46302f3f993ff8f7943823243a5d1a6d Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 5 Feb 2015 14:07:32 +0100 Subject: Reimplemented `Contains` and `Delete` in terms of `Apply` * both depict the very usecase partial function application via `Apply` is suited for --- src/list/operation/contains.h | 14 +++++--------- src/list/operation/delete.h | 14 +++++--------- 2 files changed, 10 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/list/operation/contains.h b/src/list/operation/contains.h index d3f95fa..51d7d9f 100644 --- a/src/list/operation/contains.h +++ b/src/list/operation/contains.h @@ -3,6 +3,7 @@ #include "type.h" #include "higher/query.h" +#include "function/apply.h" namespace tav { @@ -10,15 +11,10 @@ template < typename Element, typename List > -class Contains { - private: - template - using comparator = EqualValue; - - public: - typedef typename Any::type type; - -}; +using Contains = Any< + Apply::template single_type, + List +>; } diff --git a/src/list/operation/delete.h b/src/list/operation/delete.h index ad0a4cf..2ff674c 100644 --- a/src/list/operation/delete.h +++ b/src/list/operation/delete.h @@ -3,6 +3,7 @@ #include "type.h" #include "higher/filter.h" +#include "function/apply.h" namespace tav { @@ -10,15 +11,10 @@ template < typename Element, typename List > -class Delete { - private: - template - using comparator = EqualValue; - - public: - typedef typename Remove::type type; - -}; +using Delete = Remove< + Apply::template single_type, + List +>; } -- cgit v1.2.3