wstring is not a standard C++ header; as far as I know, std::wstring is defined in the <string> header. Other than that, I expect your code would work.
It may interest you to know that std::string and std::wstring are only typedefs of an underlying "basic_string" template:
typedef basic_string<char, char_traits<char>, allocator<char> > string;
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;
This would in essence allow you to make a string out of any data type (PODs are easiest).