我需要序列化class-field:一个指向int的指针 我自己做不到,请告诉我。
class Person
{
public:
int age; // work
int *ageptr = &age; // not work
Person();
~Person();
private:
friend class boost::serialization::access;
template <class Archive>
void serialize(Archive &ar, const unsigned int version) {
ar &BOOST_SERIALIZATION_NVP(age);
ar &BOOST_SERIALIZATION_NVP(ageptr); // error
}
};