On Wednesday 10 September 2003 5:01 pm, Andre Poenitz wrote:
> On Wed, Sep 10, 2003 at 05:39:31PM +0000, Angus Leeming wrote:
> > There are two issues.
> >
> > (a) No virtual destructor. This means you can't safely call delete on
> >     a pointer to string when the object pointed to is in fact a
> >     derived_from_string.
> >
> > (b) It isn't designed for polymorphism. (Like most of the standard
> >     library.) Public inheritance is usually used for
> >     polymorphism. Note (a) is a symptom of (b) .
> >
> > If you somehow know you'll never use the derived_from_string
> >     polymorphically, you won't encounter problems.
>
> I think we know that this won't happen but Lars probably wants some
> 'guarantee enforcable by the compiler' which still ...
>
> > However, before proceeding, try private inheritance combined with a
> >     few well-placed using statements. That is safer.
>
> ... leaves this as an option.

What we should do is put some hard numbers to all this. The only reason to go 
down this route at all is to reduce compile times, right?

If that is the case, then it is enough to just 'suck it and see' and post back 
the results.

Note, I shall not be doing this. I'm off to Scotland for a few days.

Angus

Reply via email to