Quick Sort Implementation C++11 Here is qsort implementation using iterators as it is in std::sort

// iterator check
template &lt;typename It, typename T&gt;
constexpr bool is = std::is_same&lt;std::iterator_traits&lt;It&gt;::iterator_category, T&gt;::value;


// quick sort
template &lt;typename BidIt, typename Pred&gt;
void qsort(BidIt first, BidIt last, Pred compare) noexcept
{
    static_assert(is&lt;BidIt, std::bidirectional_iterator_tag&gt; || is&lt;BidIt, std::random_access_iterator_tag&gt;,
        "bidirectional iterator required");

    auto size = std::distance(first, last);

    if (size &gt; 1) {
        using content_type = std::iterator_traits&lt;BidIt&gt;::value_type;

        content_type pivot = *first;
        std::vector&lt;content_type&gt; left(size), right(size);
        auto left_end = left.begin();
        auto right_end = right.begin();

        for (BidIt i = std::next(first); i != last; ++i) {
            compare(*i, pivot) ? *left_end++ = *i : *right_end++ = *i;
        }

        qsort(left.begin(), left_end, compare);
        qsort(right.begin(), right_end, compare);

        std::copy(left.begin(), left_end, first);
        *std::next(first, std::distance(left.begin(), left_end)) = pivot;
        std::copy(right.begin(), right_end, std::next(first, std::distance(left.begin(), left_end) + 1));
    }
}


Your thoughts?
Advice 1

You can save some indentation space:

if (size &gt; 1) {
    ... // Lots of code.
}


to

if (size &lt; 2) {
    return;
}
... // Lots of code here.


Advice 2

You can do the partitioning in-place; there is no need for asking for more memory. The pseudocode in Wikipedia is rather detailed, uses no auxiliary memory (except for the recursion stack, of course) and is easy to follow.