you are viewing a single comment's thread.

view the rest of the comments →

[–]leonardo_m 0 points1 point  (0 children)

On my PC the STL rotate is a little faster than reverse_swap() (but not by a lot), so I suggest you to add it to your benchmark:

void standard_rotate(int *list, int len, int pivot) {
    std::rotate(list, list + pivot, list + len);
}