Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-09-21 10:17:59


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.

> 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.


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