has_virtual_destructor.qbk 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. [/
  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. [section:has_virtual_destructor has_virtual_destructor]
  8. template <class T>
  9. struct has_virtual_destructor : public __tof {};
  10. __inherit If T is a (possibly cv-qualified) type with a virtual destructor
  11. then inherits from __true_type, otherwise inherits from __false_type.
  12. __compat There is currently no
  13. way to portably implement this trait: the default version
  14. always inherits from __false_type, and has to be explicitly specialized for
  15. types with virtual destructors unless the compiler used has compiler __intrinsics
  16. that enable the trait to do the right thing:
  17. Currently (June 2015) compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0,
  18. Intel-11.0, plus Codegear and Clang have the necessary compiler __intrinsics to ensure that this
  19. trait "just works". You may also test to see if the necessary __intrinsics are available
  20. by checking to see if the macro `BOOST_HAS_VIRTUAL_DESTRUCTOR` is defined.
  21. __std_ref 12.4.
  22. __header ` #include <boost/type_traits/has_virtual_destructor.hpp>` or ` #include <boost/type_traits.hpp>`
  23. [endsect]