Index: src/vector.h |
diff --git a/src/vector.h b/src/vector.h |
index 895c61b4ece176acfe8820f13779140ff3c552c2..d022fde3a5bb25d88b7fba5e9ca4ae375e94d20b 100644 |
--- a/src/vector.h |
+++ b/src/vector.h |
@@ -69,6 +69,10 @@ class Vector { |
return Vector<T>(result, length_); |
} |
+ void Sort(int (*cmp)(const T*, const T*), size_t s, size_t l) { |
+ std::sort(start() + s, start() + s + l, RawComparer(cmp)); |
+ } |
+ |
void Sort(int (*cmp)(const T*, const T*)) { |
std::sort(start(), start() + length(), RawComparer(cmp)); |
} |
@@ -77,6 +81,16 @@ class Vector { |
std::sort(start(), start() + length()); |
} |
+ void StableSort(int (*cmp)(const T*, const T*), size_t s, size_t l) { |
+ std::stable_sort(start() + s, start() + s + l, RawComparer(cmp)); |
+ } |
+ |
+ void StableSort(int (*cmp)(const T*, const T*)) { |
+ std::stable_sort(start(), start() + length(), RawComparer(cmp)); |
+ } |
+ |
+ void StableSort() { std::stable_sort(start(), start() + length()); } |
+ |
void Truncate(int length) { |
DCHECK(length <= length_); |
length_ = length; |