Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-01-18 01:31:39


I can't see what you're trying to do here. The following would seem to be
equivalent to your intention

#include <fstream>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/serialization/shared_ptr.hpp>
class A {
public:
    friend class boost::serialization::access;
    template<class Archive>
    void serialize(
        Archive& ar, const unsigned int version
    ) {
        ar & aptr;
    }
private:
    A * aptr;
};

int main() {
    std::ofstream ofs("archive");
    boost::archive::text_oarchive oa(ofs);
    const A a;
    oa << a;
    return 0;
}

It doesn't do anything useful but it does compile.

I think you would find that spending some more time
with the documentation and the examples would be
a good investment.

Robert Ramey


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