diff options
Diffstat (limited to 'src/list')
-rw-r--r-- | src/list/list.h | 1 | ||||
-rw-r--r-- | src/list/operation/higher/sort.h | 18 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/list/list.h b/src/list/list.h index 1a4c260..edb52ec 100644 --- a/src/list/list.h +++ b/src/list/list.h @@ -1,6 +1,7 @@ #ifndef TYPEASVALUE_SRC_LIST_LIST_H_ #define TYPEASVALUE_SRC_LIST_LIST_H_ +#include "type.h" #include "cons.h" #include "detail/fold_variadic.h" diff --git a/src/list/operation/higher/sort.h b/src/list/operation/higher/sort.h index 26d99e6..925ab89 100644 --- a/src/list/operation/higher/sort.h +++ b/src/list/operation/higher/sort.h @@ -14,31 +14,31 @@ template < template<typename, typename> class Comparator, typename Sequence > -class Sort { +class quick_sort { private: - using index = Divide<tav::Length<Sequence>, Size<2>>; - using pivot = tav::Nth<index, Sequence>; + using index = Divide<Length<Sequence>, Size<2>>; + using pivot = Nth<index, Sequence>; using partitions = Partition< Apply<Comparator, pivot, _0>::template function, DeleteNth<index, Sequence> >; - using lhs = tav::Car<partitions>; - using rhs = tav::Cdr<partitions>; + using lhs = Car<partitions>; + using rhs = Cdr<partitions>; public: using type = Concatenate< List< - Eval<Sort<Comparator, lhs>>, + Eval<quick_sort<Comparator, lhs>>, List<pivot>, - Eval<Sort<Comparator, rhs>> + Eval<quick_sort<Comparator, rhs>> > >; }; template <template<typename, typename> class Comparator> -struct Sort<Comparator, void> { +struct quick_sort<Comparator, void> { typedef void type; }; @@ -48,7 +48,7 @@ template < template<typename, typename> class Comparator, typename Sequence > -using Sort = Eval<detail::Sort<Comparator, Sequence>>; +using Sort = Eval<detail::quick_sort<Comparator, Sequence>>; } |