This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
locale::global and wcout
- From: "Kristian Spangsege" <kristian dot spangsege at gmail dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 3 Jul 2007 01:36:17 +0200
- Subject: locale::global and wcout
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