
It doesn't do it in a portable manner. OK, so that's what you meant. Yeah, that's a problem. I'd argue that basic_string<wchar_t> isn't exactly Unicode at all, though I'm being nit-picky. char_traits<wchar_t>::state_type is mbstate_t, That has nothing to do with what basic_string<wchar_t> is, though, because that state is to be used when converting the string to an external encoding. It just shows how screwed-up the current system is: char_traits<Ch>::state_type is a type that should be able to hold the shift state when converting to a (runtime-specified through the locale) external encoding - but the shift state is specific to the _external encoding_, not the internal one. It doesn't make any sense whatsoever
James Porter wrote: that char_traits for the wide character type (and thus the indicator of the _internal encoding_) should hold this type. Sebastian Redl