Would std::basic_string be preferable to std::wstring on Windows?

后端 未结 3 2363
遇见更好的自我
遇见更好的自我 2021-02-20 13:36

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

3条回答
  •  佛祖请我去吃肉
    2021-02-20 13:59

    I believe the time when it was advisable to release non-unicode versions of your application (to support Win95, or to save a KB or two) is long past: nowadays the underlying Windows system you'll support are going to be unicode-based (so using char-based system interfaces will actually complicate the code by interposing a shim layer from the library) and it's doubtful whether you'd save any space at all. Go std::wstring, young man!-)

提交回复
热议问题