As I understand it, Windows #defines TCHAR as the correct character type for your application based on the build - so it is wchar_t
in UNICODE builds and char
otherwise.
Because of this I wondered if std::basic_string<TCHAR>
would be preferable to std::wstring
, since the first would theoretically match the character type of the application, whereas the second would always be wide.
So my question is essentially: Would std::basic_string<TCHAR>
be preferable to std::wstring
on Windows? And, would there be any caveats (i.e. unexpected behavior or side effects) to using std::basic_string<TCHAR>
? Or, should I just use std::wstring
on Windows and forget about it?