On Wednesday, December 18, 2002, at 05:03 PM, Robert Ramey wrote:

From: Matthias Troyer <[EMAIL PROTECTED]>

template<class Archive>
void save(Archive &ar, T& t)
{
	ar << member1;
	...
}


Here we have a problem as far as I can see: if the class is
polymorphic, how can I serialize the derived class by calling the
save() function of the base class?
the current serialization code doesn't rely on save being virtual
to function.  It downcasts the base class pointer to the most
derived class and calls the save function on the recast pointer.
This casting is implemented by void_cast.
How can you determine the most derived class? Do you try all classes that were registered to find the most derived one?

Matthias

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to