]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/type_traits/has_nothrow_destructor.hpp
bump version to 18.2.4-pve3
[ceph.git] / ceph / src / boost / boost / type_traits / has_nothrow_destructor.hpp
1
2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
3 // Use, modification and distribution are subject to the Boost Software License,
4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt).
6 //
7 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
8
9 #ifndef BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
10 #define BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
11
12 #include <boost/type_traits/has_trivial_destructor.hpp>
13
14 #if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(__SUNPRO_CC) && !(defined(BOOST_MSVC) && (_MSC_FULL_VER < 190023506))
15
16 #include <boost/type_traits/declval.hpp>
17 #include <boost/type_traits/is_destructible.hpp>
18 #include <boost/type_traits/is_complete.hpp>
19 #include <boost/static_assert.hpp>
20
21 namespace boost{
22
23 namespace detail{
24
25 template <class T, bool b>
26 struct has_nothrow_destructor_imp : public boost::integral_constant<bool, false>{};
27 template <class T>
28 struct has_nothrow_destructor_imp<T, true> : public boost::integral_constant<bool, noexcept(boost::declval<T*&>()->~T())>{};
29
30 }
31
32 template <class T> struct has_nothrow_destructor : public detail::has_nothrow_destructor_imp<T, boost::is_destructible<T>::value>
33 {
34 BOOST_STATIC_ASSERT_MSG(boost::is_complete<T>::value, "Arguments to has_nothrow_destructor must be complete types");
35 };
36 template <class T, std::size_t N> struct has_nothrow_destructor<T[N]> : public has_nothrow_destructor<T>
37 {
38 BOOST_STATIC_ASSERT_MSG(boost::is_complete<T>::value, "Arguments to has_nothrow_destructor must be complete types");
39 };
40 template <class T> struct has_nothrow_destructor<T&> : public integral_constant<bool, false>{};
41 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
42 template <class T> struct has_nothrow_destructor<T&&> : public integral_constant<bool, false>{};
43 #endif
44 template <> struct has_nothrow_destructor<void> : public false_type {};
45 }
46 #else
47
48 namespace boost {
49
50 template <class T> struct has_nothrow_destructor : public ::boost::has_trivial_destructor<T> {};
51
52 } // namespace boost
53
54 #endif
55
56 #endif // BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED