|
|
От: |
uzhas
|
|
| Дата: | 20.04.11 06:31 | ||
| Оценка: | 3 (1) | ||
попробуйте добавить виртуальный деструктор в базуIt turns out that the kind of object serialized depends upon whether the base class (base in this case) is polymophic or not. If base is not polymorphic, that is if it has no virtual functions, then an object of the type base will be serialized. Information in any derived classes will be lost. If this is what is desired (it usually isn't) then no other effort is required.
If the base class is polymorphic, an object of the most derived type (derived_one or derived_two in this case) will be serialized. The question of which type of object is to be serialized is (almost) automatically handled by the library.