has_trivial_destructor.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. //
  6. // See http://www.boost.org/libs/type_traits for most recent version including documentation.
  7. #ifndef BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED
  8. #define BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED
  9. #include <boost/type_traits/intrinsics.hpp>
  10. #include <boost/type_traits/integral_constant.hpp>
  11. #ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR
  12. #if defined(BOOST_INTEL) || defined(BOOST_MSVC)
  13. #include <boost/type_traits/is_pod.hpp>
  14. #endif
  15. #ifdef BOOST_HAS_SGI_TYPE_TRAITS
  16. #include <boost/type_traits/is_same.hpp>
  17. #endif
  18. #if defined(__GNUC__) || defined(__clang__) || defined(__SUNPRO_CC)
  19. #include <boost/type_traits/is_destructible.hpp>
  20. #endif
  21. namespace boost {
  22. template <typename T> struct has_trivial_destructor : public integral_constant<bool, BOOST_HAS_TRIVIAL_DESTRUCTOR(T)>{};
  23. #else
  24. #include <boost/type_traits/is_pod.hpp>
  25. namespace boost{
  26. template <typename T> struct has_trivial_destructor : public integral_constant<bool, ::boost::is_pod<T>::value>{};
  27. #endif
  28. template <> struct has_trivial_destructor<void> : public false_type{};
  29. #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
  30. template <> struct has_trivial_destructor<void const> : public false_type{};
  31. template <> struct has_trivial_destructor<void const volatile> : public false_type{};
  32. template <> struct has_trivial_destructor<void volatile> : public false_type{};
  33. #endif
  34. } // namespace boost
  35. #endif // BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED