This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Status of time_get and time_put facets
- From: Martin Sebor <sebor at roguewave dot com>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: libstdc++ at gcc dot gnu dot org, Benjamin Kosnik <bkoz at constant dot com>, nicoara at roguewave dot com
- Date: Wed, 29 Jan 2003 11:54:20 -0700
- Subject: Re: Status of time_get and time_put facets
- Organization: Rogue Wave Software, Inc.
- References: <3E381212.6090901@roguewave.com> <3E3814DA.2050905@roguewave.com> <3E382025.1080206@unitus.it>
Paolo Carlini wrote:
Martin Sebor wrote:
The time_put facet also seems broken (see below).
Hi.
Your example works fine for me if I add an
std::cout.imbue(loc);
just before the for loop.
Isn't that required?!?
I don't see why. The stream is used for flags and all facets other
than time_put (i.e., ctype in this case), the text of the names
of months comes from the time_put (or more likely, time_put_byname)
obtained from the de_DE locale.
If I should take a guess, the __timepunct facet in the libstdc++
implementation is obtained by the time_put (and likely also
time_get) facet from the stream passed to the facet, and since
that object's locale is a plain old C locale, the retrieved data
do not reflect those in the de_DE locale the time_put facet comes
from. That's unexpected and incorrect.
Regards
Martin