
18 Mar
2011
18 Mar
'11
4:28 p.m.
On 3/18/2011 9:30 AM, simone pilozzi wrote:
Now I would like to allocate the xml file created with the use of this class in a vector, and this is the function:
void
getFromFile(std::vector<Contact>& contacts,constchar* file){
std::ifstream ifile(file);
boost::archive::xml_iarchive ia(ifile);
ia >> contacts;
ifile.close();
}
You need to specify an NVP for contacts as well, like so: ia >> boost::serialization::make_nvp( "contacts", contacts );