This is not strictly an answer, just a workaround.
In the base class add:
virtual void StreamToArchive(boost::archive::text_oarchive &oa) = 0;
then define a STREAMTOARCHIVE macro and place it in each of the derived classes.
#define STREAMTOARCHIVE void StreamToArchive(boost::archive::text_oarchive &oa) { oa << *this; }
Then basically replace
oa << base;
from
base.StreamToArchive(oa);
Yes, I know, this is ugly, but .. it works well, and I just have to put this STREAMTOARCHIVE macro into derived classes ... I can live with it ...
But then ... disassemble it back into the object, now that's another matter ...
Edited: changed 'this' to '* this'
source share