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: time_put facet implementation


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.

Attachment: pgp00000.pgp
Description: PGP signature


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