Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the fate of wchar_t in c++0x?

What is the fate of wchar_t in c++0x considering the new character types char8_t, char16_t, and char32_t?

More importantly, what about std::wstring, std::wcout, etc?

Are the w* family classes deprecated?
Are there new std::ustring and std::Ustring classes for new character types?

like image 938
deft_code Avatar asked May 13 '11 20:05

deft_code


People also ask

What does wchar_t mean in C++?

The wchar_t type is an implementation-defined wide character type. In the Microsoft compiler, it represents a 16-bit wide character used to store Unicode encoded as UTF-16LE, the native character type on Windows operating systems.

Is wchar_t signed or unsigned?

wchar_t is unsigned. Corresponding assembly code says movzwl _BOM, %eax .

What does Wchar stand for?

This document sets out the walking, cycling and horse-riding assessment and review (WCHAR) process for highway schemes on motorways and all-purpose trunk roads.


1 Answers

Nothing happens to wchar_t, it is still implementation specific (and compatible with C).

The new types char16_t and char32_t have defined semantics in the new standard. The old wchar_t might be equivalent to one of those, but likely to a different one on different implementations. Or none of them, on some systems.

You will have typedefs u16string and u32string for strings of the new character types, but no new standard streams.

like image 197
Bo Persson Avatar answered Oct 06 '22 05:10

Bo Persson