aboutsummaryrefslogtreecommitdiff
path: root/common/algorithm.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/algorithm.h')
-rw-r--r--common/algorithm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/algorithm.h b/common/algorithm.h
index d3f518b225..9d22af4090 100644
--- a/common/algorithm.h
+++ b/common/algorithm.h
@@ -197,6 +197,21 @@ T sortPartition(T first, T last, T pivot, StrictWeakOrdering &comp) {
/**
* Simple sort function, modeled after std::sort.
* It compares data with the given comparator object comp.
+ *
+ * Like std::sort this is not guaranteed to be stable.
+ *
+ * Two small quotes from wikipedia about stability:
+ *
+ * Stable sorting algorithms maintain the relative order of records with
+ * equal keys.
+ *
+ * Unstable sorting algorithms may change the relative order of records with
+ * equal keys, but stable sorting algorithms never do so.
+ *
+ * For more information on that topic check out:
+ * http://en.wikipedia.org/wiki/Sorting_algorithm#Stability
+ *
+ * NOTE: Actually as the time of writing our implementation is unstable.
*/
template<typename T, class StrictWeakOrdering>
void sort(T first, T last, StrictWeakOrdering comp) {