Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-01-20 18:23:06


"Ralf W. Grosse-Kunstleve" <rwgk_at_[hidden]> writes:

> I am in the process of cleaning up the boost tree such that we can compile all
> our code with g++ -Wall -W warnings. The required changes are mostly trivial,
> but here is one I am not sure about:
>
> .../boost/boost/type_traits/is_polymorphic.hpp:28: warning: `struct
> boost::detail::is_polymorphic_imp1<cctbx::maptbx::mapper_factory<cctbx::maptbx::asu,
> double, long int> >::d1' has virtual functions but non-virtual destructor
>
> .../boost/boost/type_traits/is_polymorphic.hpp:28: warning: `struct
> boost::detail::is_polymorphic_imp1<iotbx::detectors::Mar345Adaptor>::d1' has
> virtual functions but non-virtual destructor
>
> Could or should a virtual destructor be added here?

It's safe to do so, but the warning is bogus, i.e. it's not a problem
that there's a nonvirtual dtor. In some cases adding the dtor might
increase the program image size a little.

-- 
Dave Abrahams
Boost Consulting
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