Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-11-27 11:34:17


When I switched Boost.Python from its own version of is_polymorphic to
the current type trait, I started getting the following warning from

    c:/boost/boost/type_traits/is_polymorphic.hpp:22: warning: `struct
       boost::detail::is_polymorphic_imp1<V>::d1' has virtual functions but
       non-virtual destructor

So I just patched is_polymorphic.hpp as follows:

*** is_polymorphic.hpp 21 Nov 2002 08:46:49 -0000 1.4
--- is_polymorphic.hpp 27 Nov 2002 16:39:14 -0000 1.5
*** 21,27 ****
--- 21,29 ----
     struct d1 : public ncvT
+ # if !defined(__GNUC__) // this raises warnings with some classes, and buys nothing with GCC
+ # endif
        char padding[256];
     struct d2 : public ncvT

I assume the current definition of ~d1() is because some compilers
generate an implicit destructor with a non-empty
exception-specification, which then causes an error? I'm wondering if
we wouldn't be better off just defining ~d1 for those compilers, since
many other compilers are likely to raise the same warning as above.

                       David Abrahams
   dave_at_[hidden] *
Boost support, enhancements, training, and commercial distribution

Boost list run by bdawes at, gregod at, cpdaniel at, john at