locale::global and wcout
Kristian Spangsege
kristian.spangsege@gmail.com
Mon Jul 2 23:36:00 GMT 2007
GCC version: 4.1.1 20070105 (Red Hat 4.1.1-51)
I just discovered that wcout is affected when setting the global
locale using locale::global(...) - although only when the locale is
set before the first reference to wcout. In particular with respect to
the 'CTYPE' facet.
This appears to be in violation of a statement made by BS in "The C++
programming language, third edition" page 650 (mid):
"Setting the global locale does not change the behavior of existing
streams that are using the previous value of the global locale. In
particular, cin, cout, etc., are not affected. If they should be
chnaged, they must be explicitly imbued ( ) d."
So, is this an intended deviation from the standard, or am I missing something?
Strangely, I was unable to find any mention of this in the standard
(the version available via the below link.)
http://www.cantrip.org/lib-locales.html
More information about the Libstdc++
mailing list