Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-21 11:57:40


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

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

I'm not sure we want a trait that gives false positives on all
implementations.

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

If it's worth storing an extra pointer for every shared object in the
shared_ptr case, surely it's worth detecting this one at compile time?

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