blob: d7fb8bf9af10ba9769b2d1c2903a2b1682c32a9b [file] [log] [blame]
Brian Silverman4a2409e2018-08-04 23:24:02 -07001[/
2 Copyright 2007 John Maddock.
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at
5 http://www.boost.org/LICENSE_1_0.txt).
6]
7
8[section:has_virtual_destructor has_virtual_destructor]
9 template <class T>
10 struct has_virtual_destructor : public __tof {};
11
12__inherit If T is a (possibly cv-qualified) type with a virtual destructor
13then inherits from __true_type, otherwise inherits from __false_type.
14
15__compat There is currently no
16way to portably implement this trait: the default version
17always inherits from __false_type, and has to be explicitly specialized for
18types with virtual destructors unless the compiler used has compiler __intrinsics
19that enable the trait to do the right thing:
20Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0,
21Intel-11.0, plus Codegear and Clang have the necessary compiler __intrinsics to ensure that this
22trait "just works". You may also test to see if the necessary __intrinsics are available
23by checking to see if the macro `BOOST_HAS_VIRTUAL_DESTRUCTOR` is defined.
24
25
26__std_ref 12.4.
27
28__header ` #include <boost/type_traits/has_virtual_destructor.hpp>` or ` #include <boost/type_traits.hpp>`
29
30[endsect]
31