Implementation of quicksort in c++ using templates