template quicksort in cpp but still uses sizes :(