File indexing completed on 2025-12-15 10:09:49
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_TT_IS_CLASS_HPP_INCLUDED
0011 #define BOOST_TT_IS_CLASS_HPP_INCLUDED
0012
0013 #include <boost/type_traits/detail/config.hpp>
0014 #include <boost/type_traits/intrinsics.hpp>
0015 #include <boost/type_traits/integral_constant.hpp>
0016 #ifndef BOOST_IS_CLASS
0017 # include <boost/type_traits/is_union.hpp>
0018
0019 #ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
0020 # include <boost/type_traits/detail/yes_no_type.hpp>
0021 #else
0022 # include <boost/type_traits/is_scalar.hpp>
0023 # include <boost/type_traits/is_array.hpp>
0024 # include <boost/type_traits/is_reference.hpp>
0025 # include <boost/type_traits/is_void.hpp>
0026 # include <boost/type_traits/is_function.hpp>
0027 #endif
0028
0029 #endif
0030
0031 namespace boost {
0032
0033 namespace detail {
0034
0035 #ifndef BOOST_IS_CLASS
0036 #ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 #if defined(__GNUC__) && !defined(__EDG_VERSION__)
0049
0050 template <class U> ::boost::type_traits::yes_type is_class_tester(void(U::*)(void));
0051 template <class U> ::boost::type_traits::no_type is_class_tester(...);
0052
0053 template <typename T>
0054 struct is_class_impl
0055 {
0056
0057 BOOST_STATIC_CONSTANT(bool, value =
0058 sizeof(is_class_tester<T>(0)) == sizeof(::boost::type_traits::yes_type)
0059 && ! ::boost::is_union<T>::value
0060 );
0061 };
0062
0063 #else
0064
0065 template <typename T>
0066 struct is_class_impl
0067 {
0068 template <class U> static ::boost::type_traits::yes_type is_class_tester(void(U::*)(void));
0069 template <class U> static ::boost::type_traits::no_type is_class_tester(...);
0070
0071 BOOST_STATIC_CONSTANT(bool, value =
0072 sizeof(is_class_tester<T>(0)) == sizeof(::boost::type_traits::yes_type)
0073 && ! ::boost::is_union<T>::value
0074 );
0075 };
0076
0077 #endif
0078
0079 #else
0080
0081 template <typename T>
0082 struct is_class_impl
0083 {
0084 BOOST_STATIC_CONSTANT(bool, value =
0085 ! ::boost::is_union<T>::value >::value
0086 && ! ::boost::is_scalar<T>::value
0087 && ! ::boost::is_array<T>::value
0088 && ! ::boost::is_reference<T>::value
0089 && ! ::boost::is_void<T>::value
0090 && ! ::boost::is_function<T>::value
0091 );
0092 };
0093
0094 # endif
0095 # else
0096 template <typename T>
0097 struct is_class_impl
0098 {
0099 BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_CLASS(T));
0100 };
0101 # endif
0102
0103 }
0104
0105 template <class T> struct is_class : public integral_constant<bool, ::boost::detail::is_class_impl<T>::value> {};
0106 # ifdef __EDG_VERSION__
0107 template <class T> struct is_class<const T> : public is_class<T>{};
0108 template <class T> struct is_class<const volatile T> : public is_class<T>{};
0109 template <class T> struct is_class<volatile T> : public is_class<T>{};
0110 # endif
0111
0112 }
0113
0114 #endif