Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] Strange giant warning
From: Roman Perepelitsa (roman.perepelitsa_at_[hidden])
Date: 2010-03-08 10:20:08


2010/3/8 David <evildavo_at_[hidden]>

> Nothing stands out to me. Polymorphic.... hmm... I don't do anything of
> the sort in my example.
> Doesn't really explain why the warning is there does it.
>

What if someone implemented a class that inherits Game and serialized that
to an archive? When reading shared_ptr<Game> from such an archive,
serialization library does no know in advance which type should be used to
create an object, hence the need for a type to be polymorphic.

Adding a virtual function (e.g. destructor) fixes the problem for you?

Roman Perepelitsa.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net