File indexing completed on 2025-01-18 09:53:10
0001 #ifndef BOOST_TT_IS_ABSTRACT_CLASS_HPP
0002 #define BOOST_TT_IS_ABSTRACT_CLASS_HPP
0003
0004 #if defined(_MSC_VER)
0005 # pragma once
0006 #endif
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 #include <cstddef> // size_t
0052 #include <boost/type_traits/intrinsics.hpp>
0053 #include <boost/type_traits/integral_constant.hpp>
0054 #ifndef BOOST_IS_ABSTRACT
0055 #include <boost/static_assert.hpp>
0056 #include <boost/type_traits/detail/yes_no_type.hpp>
0057 #include <boost/type_traits/is_class.hpp>
0058 #ifdef BOOST_NO_IS_ABSTRACT
0059 #include <boost/type_traits/is_polymorphic.hpp>
0060 #endif
0061 #endif
0062
0063 namespace boost {
0064
0065 namespace detail{
0066
0067 #ifdef BOOST_IS_ABSTRACT
0068 template <class T>
0069 struct is_abstract_imp
0070 {
0071 BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_ABSTRACT(T));
0072 };
0073 #elif !defined(BOOST_NO_IS_ABSTRACT)
0074 template<class T>
0075 struct is_abstract_imp2
0076 {
0077
0078
0079
0080
0081 template<class U>
0082 static type_traits::no_type check_sig(U (*)[1]);
0083 template<class U>
0084 static type_traits::yes_type check_sig(...);
0085
0086
0087
0088
0089 BOOST_STATIC_ASSERT(sizeof(T) != 0);
0090
0091
0092
0093 #ifdef __GNUC__
0094 BOOST_STATIC_CONSTANT(std::size_t, s1 = sizeof(is_abstract_imp2<T>::template check_sig<T>(0)));
0095 #else
0096 #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
0097 #pragma warning(push)
0098 #pragma warning(disable:6334)
0099 #endif
0100 BOOST_STATIC_CONSTANT(std::size_t, s1 = sizeof(check_sig<T>(0)));
0101 #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
0102 #pragma warning(pop)
0103 #endif
0104 #endif
0105
0106 BOOST_STATIC_CONSTANT(bool, value =
0107 (s1 == sizeof(type_traits::yes_type)));
0108 };
0109
0110 template <bool v>
0111 struct is_abstract_select
0112 {
0113 template <class T>
0114 struct rebind
0115 {
0116 typedef is_abstract_imp2<T> type;
0117 };
0118 };
0119 template <>
0120 struct is_abstract_select<false>
0121 {
0122 template <class T>
0123 struct rebind
0124 {
0125 typedef false_type type;
0126 };
0127 };
0128
0129 template <class T>
0130 struct is_abstract_imp
0131 {
0132 typedef is_abstract_select< ::boost::is_class<T>::value> selector;
0133 typedef typename selector::template rebind<T> binder;
0134 typedef typename binder::type type;
0135
0136 BOOST_STATIC_CONSTANT(bool, value = type::value);
0137 };
0138
0139 #endif
0140 }
0141
0142 #ifndef BOOST_NO_IS_ABSTRACT
0143 template <class T> struct is_abstract : public integral_constant<bool, ::boost::detail::is_abstract_imp<T>::value> {};
0144 #else
0145 template <class T> struct is_abstract : public integral_constant<bool, ::boost::detail::is_polymorphic_imp<T>::value> {};
0146 #endif
0147
0148 }
0149
0150 #endif