Ditch the template. This should work:
#include <string> // or wstring
#include <cctype>
... and ...
for (auto & c: str) c = std::toupper(c);
You probably want to avoid the _toupper macro. One definition looks like this:
#define _toupper(_Char) ( (_Char)-'a'+'A' )
If you want a copy, rather than in-place, do this:
std::string original;
auto str = original;
for (auto & c: str) c = std::toupper(c);