Robert Ramey wrote:
RIVASSEAU Jean Noel wrote:
Ok, I will try to send a small example to the list tomorrow. In fact I think everything lies in the fact that using boost::serialization::base_object also registers the fact that the classes are parent and child. The serialization system needs to know that in order to make casts later.
Somehow it probably does not like it when it tries to register several different classes as the parent of the same class.
Note that there is a test test_..._mi which tests serialization with classes which have multiple parents. So I would hope that this wouldn't be a problem. But you never know
Robert, the problem Jean is having is not related to multiple inheritance.
The problem above is best described:
class version 1:
================
struct base_old{ ... };
struct derived : base_old { ... };
class version 2:
================
struct base_new{ ... };
struct derived : base_new { ... };
What would the serialize or save/load function look like to support archives
containing version 1? I'd assume something along the lines of:
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
if( version == 2)
{
ar & boost::serialization::base_object