From 709274402ff0a83dfaacae880dfa6db478d29ab1 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 9 Feb 2015 15:46:26 +0100 Subject: Updated `Sort` to make use of `Partition` for splitting at pivot * added further test cases for `Sort` as well as `Nth` aliae --- src/list/operation/higher/sort.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/list/operation/higher/sort.h b/src/list/operation/higher/sort.h index 0ff5c40..a707a15 100644 --- a/src/list/operation/higher/sort.h +++ b/src/list/operation/higher/sort.h @@ -1,8 +1,9 @@ #ifndef TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_SORT_H_ #define TYPEASVALUE_SRC_LIST_OPERATION_HIGHER_SORT_H_ -#include "filter.h" #include "list/operation/concatenate.h" +#include "list/operation/higher/partition.h" +#include "function/apply.h" namespace tav { @@ -20,11 +21,13 @@ class Sort { typename Drop>, Sequence>::type >::type; - template - using comparator_wrapper = Comparator; + using partitions = typename Partition< + Apply::template single_type, + sequence_sans_pivot + >::type; - using lhs = typename Filter::type; - using rhs = typename Remove::type; + using lhs = typename Car::type; + using rhs = typename Cdr::type; public: typedef typename Concatenate< -- cgit v1.2.3