|
Boost : |
From: George M. Garner Jr. (gmgarner_at_[hidden])
Date: 2005-04-12 08:14:29
Robert,
Sorry, I just saw your other comment about not deriving from
boost::archive::xml_woarchive. :-)
If only all problems were resolved so easily.
Regards,
George.
"George M. Garner Jr." <gmgarner_at_[hidden]> escreveu na mensagem
news:d3gg2n$h3e$1_at_sea.gmane.org...
> Robert,
>
> A comment in interface_oarchive.hpp states that
> interface_oarchive<Archive>::This() is supposed to return the a pointer to
> the most derived class. Actually, it gives you a pointer to the "Archive"
> template parameter which may or may not be the most derived class,
> depending on how your internal "invoke" plumbing resolves the type. In
> the following case I was able to get the most derived class only by
> overriding both operator<<(const T & t) and save_override()(using VC2k3):
>
> class fau_xml_woarchive :
> public boost::archive::xml_woarchive
> {
> public:
> [...]
> template<class T>
> void save_override(const ::boost::serialization::nvp<T> & t, int i)
> {
> save_start(t.name());
> boost::archive::save(*this, t.value());
> save_end(t.name());
> }
> template<class T>
> _Mytype& operator<<(const T & t)
> {
> save_override(t, 0);
> return *this;
> }
> [...]
> };
>
> Was that your intention?
>
> Regards,
>
> George.
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk