Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-21 10:36:45


From: "Peter Dimov" <pdimov_at_[hidden]>

> From: "David Abrahams" <dave_at_[hidden]>
> >
> > Well, OK, there's the "deletion of incomplete type" issue (use of
> > checked_delete) which is also not provided by auto_ptr.
>
> That's because auto_ptr<Incomplete> is undefined behavior. :-)
>
> > What about the "delete slicing" issue? Should the following be
prevented
> at
> > compile-time if Base has no virtual functions?
> >
> > scoped_ptr<Base> p(new Derived);
>
> 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?

> > We could easily do that (I am using John Maddock's is_polymorphic
template
> > successfully in Boost.Python).
>
> Where is 'is_polymorphic'? I can't find it in type_traits.

It's not there. See boost/python/object/inheritance.hpp.

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


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