Boost logo

Boost Users :

From: Jan Boehme (jan.boehme_at_[hidden])
Date: 2006-11-29 05:55:30


Hi Robert,

On 11/29/06, Robert Ramey <ramey_at_[hidden]> wrote:
>
> Try
>
> ///////////////////////// without effect
> ////////////////////////////////////
> template void
>
> CSerTest::serialize<boost::archive::xml_oarchive>(boost::archive::xml_oarchive&,
> const unsigned int ); // add const !!!

Of course I did try this but the unresolved symbol is of type
CSerTest::serialize<class boost::archive::xml_oarchive>(class
boost::archive::xml_oarchive &,unsigned int)
and so I tried it without const. But the error occurs further.

// 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.

I wish it would. Do you have another hint why the explicit instantiation
doesn't work here?

Thanks for your other suggestions.

Cheers, jan



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