this piece of code has to be written every time we make a class i.e.from template<class archive>
to ar
& BOOST_SERIALIZATION_NVP(b)
. How can we make it short?
and how can we serialize the stl containers ?
class Employee
{
private:
friend class boost::serialization::access;
template<class Archive> void serialize(Archive & ar,
const unsigned int version)
{
ar & BOOST_SERIALIZATION_NVP(a);
ar & BOOST_SERIALIZATION_NVP(b);
}
int a;
int b;
public:
Employee(int a, int b)
{
this->a = a;
this->b = b;
}
};