|
Boost Users : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2006-11-29 00:39:30
Try
///////////////////////// without effect
////////////////////////////////////
template void
CSerTest::serialize<boost::archive::xml_oarchive>(boost::archive::xml_oarchive&,
const unsigned int ); // add const !!!
Also a couple of unrelated suggestions:
// Class.hpp
// the following will bloat your code even whenever you use this header even
when not actually using
// xml_?archives - so better not to include it here:
//#include <boost/archive/xml_oarchive .hpp>
//#include <boost/archive/xml_iarchive.hpp>
....
// main.cpp
#include <fstream>
#include "Class.hpp"
#include <boost/archive/xml_oarchive .hpp>
#include <boost/archive/xml_iarchive.hpp>
///////////////////////// without effect
////////////////////////////////////
template void
CSerTest::serialize<boost::archive::xml_oarchive>(boost::archive::xml_oarchive&,
const unsigned int ); // "const" added!! to match template in declaration
int main()
{
const CSerTest instance; // check rationale on this.
std::ofstream ofs( "out_file.txt" );
boost::archive::xml_oarchive oxa( ofs );
oxa << BOOST_SERIALIZATION_NVP(instance);
}
**** this should work.
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