Add a PartialCall metafunction and use it so that vector transforms now can use normal metafunctions.
diff --git a/include/fruit/impl/meta/vector.h b/include/fruit/impl/meta/vector.h
index 19a338a..3690a47 100644
--- a/include/fruit/impl/meta/vector.h
+++ b/include/fruit/impl/meta/vector.h
@@ -172,11 +172,15 @@
};
};
-template <typename ElemToRemove>
struct RemoveFromVectorHelper {
- template <typename Elem>
+ template <typename ElemToRemove, typename Elem>
struct apply {
- using type = If(IsSame(Elem, ElemToRemove), None, Elem);
+ using type = Elem;
+ };
+
+ template <typename Elem>
+ struct apply<Elem, Elem> {
+ using type = None;
};
};
@@ -184,7 +188,7 @@
struct RemoveFromVector {
template <typename T, typename V>
struct apply {
- using type = TransformVector(V, RemoveFromVectorHelper<T>);
+ using type = TransformVector(V, PartialCall(RemoveFromVectorHelper, T));
};
};