I\'m getting the error in the title. It\'s pointing to the line where the for-loop is declared. Any ideas on what is happening?
#include templa
That's a common error with multiple comma separated pointer variable declarations. Change your for loop header as follows:
for (T *i(arr+1), *j(arr+n); i != j; ++i) { // ^ Note the additional asterisk! }
See the fixed and working sample here.