I have an instance of std::u16string, can I pass its c_str() to a Win32 APIs which expects LPCWSTR, without any kind of conversion? For example, can I safely do this:
auto u16s = std::u16string(u"Hello");
::SetWindowTextW(hWnd, reinterpret_cast<LPCWSTR>(u16s.c_str()));
Updated, MSDN says here wchar_t is UTF-16LE, while char16_t is just UTF-16 with no endian specified. Is it safe to assume then that char16_t is also always UTF-16LE on Windows? Or would that be MSVC compiler specific, and so it can possibly be UTF-32LE (or maybe UTF-16BE) if I complile with GCC, for example?