This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Status of time_get and time_put facets


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]