aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/higher/partition.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/list/operation/higher/partition.h')
-rw-r--r--src/list/operation/higher/partition.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/list/operation/higher/partition.h b/src/list/operation/higher/partition.h
new file mode 100644
index 0000000..e42b971
--- /dev/null
+++ b/src/list/operation/higher/partition.h
@@ -0,0 +1,21 @@
+#ifndef TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_PARTITION_H_
+#define TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_PARTITION_H_
+
+#include "filter.h"
+
+namespace tav {
+
+template <
+ template<typename> class Predicate,
+ typename List
+>
+struct Partition {
+ typedef Cons<
+ typename Filter<Predicate, List>::type,
+ typename Remove<Predicate, List>::type
+ > type;
+};
+
+}
+
+#endif // TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_PARTITION_H_