Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-10-03 12:55:10


I suspect the problem is the following:

    ofstream ofs(filename.c_str());
    boost::archive::xml_oarchive oa(ofs);
    oa <<BOOST_SERIALIZATION_NVP(t);

here the archive is being destroyed while there still might exist something
in the output stream buffer.
Try this:

    ofstream ofs(filename.c_str());
    boost::archive::xml_oarchive oa(ofs);
    ofs.flush();
    oa <<BOOST_SERIALIZATION_NVP(t);

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