From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-19 08:23:58


----- Original Message -----
From: "Thomas Maeder" <maeder_at_[hidden]>

> Am 2002.01.18 21:36 schrieb(en) Peter Dimov:
> > Good question.
> >
> > Is there a realistic use case where the Derived* -> Base* implicit
> > conversion is useful when Base is not polymorphic? ;-)
>
> Not so good question, because the answer is obvious. :-)
>
> But I'm not sure if the two questions are as connected as they might
> seem to. I use a shared_ptr to express object ownership; and we all
> know that it's rarely wise to express ownership of a Derived object
> through a (shared) pointer to Base if the Base destructor isn't virtual.

...which is the reason it might be better if they didn't implicitly convert,
unless Peter's precautions are taken.