Boost logo

Boost Users :

From: Jan Tinkhof (boost_at_[hidden])
Date: 2006-08-12 11:21:12


Hello all,

I'm currently trying to make a library serializable and would like to be
as non-intrusive as possible.

Unfortunately this library (ODE) uses its own forms of linked lists to
manage its objects and the links include a "pointer-to-pointer-to-type"
(type**).

How do I go about serializing these? Why doesn't this compile?

#include <fstream>
#include <boost/archive/text_oarchive.hpp>

struct mystruct {
        int i;
};

template<class Archive>
void serialize(Archive& ar, mystruct& ms, const unsigned int version)
{
        ar & ms.i;
}
BOOST_CLASS_TRACKING(mystruct, boost::serialization::track_always)

int main( int argc, char* argv[], char* envp[] )
{
        std::ofstream ofilestream("filename.txt");
        boost::archive::text_oarchive oarchive(ofilestream);

        mystruct a;
        mystruct* pa = &a;
        mystruct** ppa = &pa;
        
        oarchive << ppa;

}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net