aboutsummaryrefslogtreecommitdiff
path: root/src/list/operation/higher/sort.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-02-16 16:35:38 +0100
committerAdrian Kummerlaender2015-02-16 16:35:38 +0100
commit5a9366307d23b220657629c494827def3544c490 (patch)
treea9ca13de33d1098a4b02755c0c29435d146cdb8f /src/list/operation/higher/sort.h
parent45c63c95293e42860ee17368ab24cc65cc60d378 (diff)
downloadTypeAsValue-5a9366307d23b220657629c494827def3544c490.tar
TypeAsValue-5a9366307d23b220657629c494827def3544c490.tar.gz
TypeAsValue-5a9366307d23b220657629c494827def3544c490.tar.bz2
TypeAsValue-5a9366307d23b220657629c494827def3544c490.tar.lz
TypeAsValue-5a9366307d23b220657629c494827def3544c490.tar.xz
TypeAsValue-5a9366307d23b220657629c494827def3544c490.tar.zst
TypeAsValue-5a9366307d23b220657629c494827def3544c490.zip
Renamed `detail::Sort` to `detail::quick_sort`
* opens up the possibility of implementing different sort algorithms in this library * removed now unnecessary namespace prefixes
Diffstat (limited to 'src/list/operation/higher/sort.h')
-rw-r--r--src/list/operation/higher/sort.h18
1 files changed, 9 insertions, 9 deletions
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>>;
}