Status of time_get and time_put facets
Martin Sebor
sebor@roguewave.com
Wed Jan 29 18:55:00 GMT 2003
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
More information about the Libstdc++
mailing list