Learning quicksort, templates