QuickSort C++ Implmentation using Iterators #2
You still have the same UB as in the original question. An unpleasant (i + 1) suggests the fix: first swap, then advance:

        itr i=left;
        itr it=left;

        while(it&lt;right)
        {
            if(*it&lt;*right)
            {
                using std::swap;

                swap(*i,*it);
                std::advance(i,1);
            }
            std::advance(it,1);
        }

        using std::swap;

        swap(*i,*right);
        return i;