Lines Matching refs:idempotent
69 template<class T, class C, bool idempotent>
84 if (!idempotent || comparator(array[left_index], array[right_index]) != 0) {
96 template<class T, class C, bool idempotent>
106 int split = partition<T, C, idempotent>(array, pivot, length, comparator);
108 inner_sort<T, C, idempotent>(array, first_part_length, comparator);
109 inner_sort<T, C, idempotent>(&array[first_part_length], length - first_part_length, comparator);
113 // The idempotent parameter prevents the sort from
119 static void sort(T* array, int length, C comparator, bool idempotent) {
120 // Switch "idempotent" from function paramter to template parameter
121 if (idempotent) {
132 template <class C> static bool sort_and_compare(int* arrayToSort, int* expectedResult, int length, C comparator, bool idempotent = false);