My current understanding of the difference between std::string and std::wstring is just a buffer type; namely char vs wchar_t , respectively.
I also read that most (if not all) linux distributions use char for all and all strings, both ASCII and UTF, where Windows is the main OS that uses wchar_t .
However, there are a few more types of strings that I want to get right in my head: u16string and u32string , which are strings with 2-byte and 4-byte buffers, respectively.
So my question is this:
On platforms with sizeof(wchar_t) == 2 , std::wstring functionally equivalent to std::u16string , as well as platforms with sizeof(wchar_t) == 4 and std::u32string ?
source share