I\'m trying to use new unicode characters in C++0x. So I wrote sample code:
#include
#include
int main()
{
std::u32string
When creating, the stream tries to obtain a 'codecvt' from the global locale, but fails to get one because the only standard codecvt's are for char and wchar_t. As a result, _M_codecvt member of the stream object is NULL. Later, during the attempt to output, your code throws an exception (not visible to user) in facet checking function in basic_ios.h, because the facet is initialized from _M_codecvt.
Add a facet to the local associated with the stream to do the conversion from char32_t to the correct output. Imbue the stream with a locale containing a codecvt of the right type.