|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2005-09-06 12:48:10
"Robert Ramey" <ramey_at_[hidden]> writes:
> I went back and checked in the tutorial. Previously I had just
> taken your assertion that it wasn't in there at face value. Under
> Tutorial/Pointers in the table of contents there is a code snippet
> and link to the complete demo which shows the serialization of a
> polymorphic base class. The text doesn't specifically say its a
> pointer to a polymorphic base class though this is obvious from the
> link to the full example.
>
> So I think this concern can be addressed by enhancing the
> explanation in this section of the tutorial.
Great! It's always nice when there's an easy fix.
Here's what I think you need to explain, in these words or yours:
When you serialize a pointer to an object of polymorphic type, the
serialization function for that object's full dynamic type is
called. Except in special circumstances, that dynamic type must
have been explicitly registered as explained in <link to that
section of the reference> before the pointer is serialized, or
serialization will fail with an unregistered_class exception.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk