|
Boost Users : |
From: Cheok Yan Cheng (yccheok_at_[hidden])
Date: 2006-07-23 21:27:17
Please take note that even the following simplest form
won't work.
Here is the full source code. Any suggestion? Thank
you very much!
#include <iostream>
#include <sstream>
#include <fstream>
using namespace std;
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
class dd
{
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int
version)
{
ar & i;
}
int i;
};
class dummy
{
public:
dummy() : d(0){}
~dummy(){}
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int
version)
{
ar & const_cast<dd *>(d);
}
const dd *d;
};
int main()
{
const dummy w;
dummy r;
// make an archive
std::ofstream ofs("dummy");
boost::archive::text_oarchive oa(ofs);
oa << w;
std::ifstream ifs("dummy");
boost::archive::text_iarchive ia(ifs);
ia >> r;
}
c:\Documents and
Settings\yccheok\Desktop\xxx\main.cpp(34): error
C2679: binary '&' : no operator found which takes a
right-hand operand of type 'dd *' (or there is no
acceptable conversion)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
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