time_put facet implementation

Sam Varshavchik mrsam@courier-mta.com
Mon Sep 28 22:03:00 GMT 2009


Paolo Carlini writes:

> Why do you think you can't instantiate it? Definitely you can, eg, this
> works fine:
> 
> #include <locale>
> #include <iterator>
> 
> struct my_facet
> : std::time_put<char, std::ostream_iterator<char> >
> {
>   my_facet() { }
> };
> 
> my_facet tp;
> 
> Note: one thing is *instantiating* the facet, per Table 52, another
> thing finding it installed in a given locale: in the latter case Table
> 51 applies, which concerns only ostreambuf_iterator based facets.

That's what I meant -- I was getting a bad cast when invoking 
std::use_facet< std::time_put<char, std::ostream_iterator<char> > >(loc).

Thanks for pointing me in the right direction.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20090928/1698bc24/attachment.sig>


More information about the Libstdc++ mailing list