Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-09-21 11:32:35


From: "David Abrahams" <dave_at_[hidden]>
> From: "Peter Dimov" <pdimov_at_[hidden]>
>
>
> > From: "David Abrahams" <dave_at_[hidden]>
> > > > A good idea, although the correct test is
> > 'has_virtual_destructor<Base>',
> > > I
> > > > think.
> > >
> > > Yes, but we don't know how to implement that, do we?
> >
> > Yep. Isn't one of the goals of the type_traits library/extension
proposal
> to
> > provide things that we can't implement, like has_trivial_destructor or
> > is_POD?
>
> Yes. Relying on those is fine for "the future", but our actual
> implementation could do something today with is_polymorphic. FWIW.

My reasoning was that has_virtual_destructor (whenever it appears in
type_traits) would be approximated with is_polymorphic (which is yet to
appear in type_traits too) anyway.

That aside, making our implementation detect the case implies a new
dependency on config.hpp (member templates) and on
type_traits/has_virtual_destructor.hpp. Is scoped_ptr<Base>(new Derived) a
common mistake? I think not, but I might be wrong.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk