ben wrote:
>
> > But in situations like the one the OP is in, the Base class
> > usually has at least one virtual function: the destructor.
>
> How do you know? I've seen plausible designs where no virtual function is
> involved in inheritance.
Because the OP posted:
> Base* base = new Derived();
> ((Derived*)base)->foo();
And since I assume that he is a good guy he will eventuall delete
the object. And for that he needs a virtual destructor or he
has undefined behaviour in his program.
--
Karl Heinz Buchegger