I realise that what I am doing is no doubt an unconventional usage of
boost::serialization, but I wonder if any one has done a similar thing
before.
I wish to serialize a derived class through a baseclass pointer, but on
deserilize I do not want the object to be created (I do not want memory
allocated) - as the object will have all ready been created.
An example, hopefully showing what I mean, is given at the end. The
program will output something like,
construct A, _m = 155640808
serialise A, _m = 155640808
construct A, _m = 155649400
serialise A, _m = 155649808
But essentially I want the program to output something lke,
construct A, _m = 155640808
serialise A, _m = 155640808
construct A, _m = 155649400
serialise A, _m = 155649400
i.e. the second lot of construct A/serialise A will have the same
address for _m.
The reason why I need this behaviour, is that only a sub-set of the
derived class will be seriliazed, with the other parts of the class
intialised differently depending on the session, and the initialisation
of the class is always done _before_ deserialisation.
Is there anyway to get this behaviour from the boost::serialization library?
Many thanks,
Darryl
Example
-------
#include <fstream>
#include