You have a variable length array:
T t[right-left+1];
This is an extension supported by your specific compiler, and not part of the C ++ standard. It does not work for complex object types such as std::string - hence the error message. You can replace it with vector :
std::vector<T> t(right - left + 1);
The ideal idea is to use pointers better, though - copying std::string objects around is pretty heavyweight (i.e. intense, slow) ... you just want to keep track of which a[] elements are moved, rather than sorting the copies from them then copy them.
source share