aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/higher/find.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/list/operation/higher/find.h')
-rw-r--r--src/list/operation/higher/find.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/list/operation/higher/find.h b/src/list/operation/higher/find.h
index abc3199..48533b7 100644
--- a/src/list/operation/higher/find.h
+++ b/src/list/operation/higher/find.h
@@ -6,16 +6,18 @@
namespace tav {
+namespace detail {
+
template <
template<typename> class Predicate,
typename Current
>
struct Find {
- typedef Eval<If<
+ typedef If<
Eval<Predicate<Head<Current>>>,
Head<Current>,
Eval<Find<Predicate, Tail<Current>>>
- >> type;
+ > type;
};
template <
@@ -27,4 +29,12 @@ struct Find<Predicate, void> {
}
+template <
+ template<typename> class Predicate,
+ typename List
+>
+using Find = Eval<detail::Find<Predicate, List>>;
+
+}
+
#endif // TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_FIND_H_