Re: [Boost-users] Boost serializer: incomplete type error reported

Thanks for your advice, Gennaro. I had to move the following includes to the beginning of the file: #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> I also realised that the following gives the same error of incomplete type: void SetOfRules::save(const string &fileName) // Save into a file { ofstream fout(fileName.c_str()); boost::archive::text_oarchive oa(fout); oa << *this; fout.close(); } I had to use a helper function like this: void _save(const SetOfRules &sor, const string &fileName); void SetOfRules::save(const string &fileName) // Save into a file { _save(*this,fileName); } void _save(const SetOfRules &sor, const string &fileName) { std::ofstream fout(fileName.c_str()); boost::archive::text_oarchive oa(fout); oa << sor; fout.close(); } // save And similarly to load a class. Diego
-- Do you want to know what is going on in Language Technology in Australia and New Zealand? Join ALTA -- http://www.alta.asn.au/ This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of Macquarie University. --------------------------------------------------------------------- Diego MOLLA ALIOD diego@ics.mq.edu.au Department of Computing http://www.ics.mq.edu.au/~diego Macquarie University
participants (1)
-
Diego Molla