http://robot.kaist.ac.kr/haptics/chai3d-2.0.0_Doc/resources/html/structc_matrix3d.html
cMatrix3d有一个班级数据成员double m [3][3];
现在纠正我,如果我错了:序列化这个类的实例我需要添加这个
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & m;//I think this is probably wrong, see error
}
到班级定义,对吧?
我收到此运行时错误:client.exe中0x758c9617处的未处理异常:Microsoft C ++异常:内存位置处的boost :: archive :: archive_exception
当我尝试从存档反序列化到对象实例时,在客户端。
std::istringstream iss(recvd_msg);
boost::archive::text_iarchive ia(iss);
cMatrix3d rot;
ia>>rot;
答案 0 :(得分:0)
尝试
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
for (int i = 0; i != 3; ++i)
{
ar & m[i];
}
}