Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

libs/type_traits/doc/has_virtual_destructor.qbk

[/ 
  Copyright 2007 John Maddock.
  Distributed under the Boost Software License, Version 1.0.
  (See accompanying file LICENSE_1_0.txt or copy at
  http://www.boost.org/LICENSE_1_0.txt).
]

[section:has_virtual_destructor has_virtual_destructor]
   template <class T>
   struct has_virtual_destructor : public __tof {};
  
__inherit If T is a (possibly cv-qualified) type with a virtual destructor
then inherits from __true_type, otherwise inherits from __false_type.

__compat This trait is provided for completeness, since it's part of the
Technical Report on C++ Library Extensions.  However, there is currently no 
way to portably implement this trait.  The default version provided 
always inherits from __false_type, and has to be explicitly specialized for 
types with virtual destructors unless the compiler used has compiler __intrinsics
that enable the trait to do the right thing: currently (May 2005) only Visual C++
8 and GCC-4.3 have the necessary __intrinsics.

__std_ref 12.4.

__header ` #include <boost/type_traits/has_virtual_destructor.hpp>` or ` #include <boost/type_traits.hpp>`

[endsect]