Quicksort implementation in C++ I was wondering if this implementation of quicksort could be improved. Are there any things that I have done wrong?

template&lt;typename Element&gt;
size_t partition_quickSort(Element arr[], size_t start, size_t end) {
    auto pivot = arr[end];
    size_t index_partition = start;

    for (size_t i = start; i &lt; end; ++i) {
        if (arr[i] &lt;= pivot) {
            std::swap(arr[index_partition++], arr[i]);
        }
    }

    std::swap(arr[index_partition], arr[end]);
    return index_partition;
}

template&lt;typename Element&gt;
void quick_sort(Element arr[], size_t start, size_t end) {
    if (start &lt; end) {
        size_t partition = partition_quickSort(arr, start, end);
        quick_sort(arr, start, partition - 1);
        quick_sort(arr, partition + 1, end);
    }
}
template&lt;typename Element&gt;
void quick_sort(Element arr[], size_t size) {
    quick_sort(arr, 0, size - 1);
}
There is just one thing wrong with your code.
Don't ever call std::swap using a qualified name. Doing so cuts out user-defined functions which might be better, or actually viable. Use using std::swap; swap(*pa, *pb); or maybe std::iter_swap(pa, pb);.
Next, there's on thing sub-optimal. You are passing the range, as well as start and end. Knowing where in the overall range the part you are currently processing is does not help, so you can eliminate an argument.
Work on genericity by following C++ conventions.
Useing half-open iterator-ranges allows wider application, you only need mutable forward-iterators.
Finally, Don't use &lt;= for comparing the elements. All the standard algorithms only use &lt;, and there's no compelling reason to break with that convention.




template &lt;class ForwardIter&gt;
void quicksort(const ForwardIter begin, const ForwardIter end) {
    if (begin == end) return;
    auto cur = begin;
    if (++cur == end) return;
    auto mid = begin;
    for (; cur != end; ++cur)
        if (*cur &lt; *begin)
            std::iter_swap(cur, ++mid);
    std::iter_swap(begin, mid);
    quicksort(begin, mid);
    quicksort(++mid, end);
}