Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:09:49

0001 //  (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
0002 //  Hinnant & John Maddock 2000-2003.
0003 //  Use, modification and distribution are subject to the Boost Software License,
0004 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 //  http://www.boost.org/LICENSE_1_0.txt).
0006 //
0007 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
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 // BOOST_IS_CLASS
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 // This is actually the conforming implementation which works with
0039 // abstract classes.  However, enough compilers have trouble with
0040 // it that most will use the one in
0041 // boost/type_traits/object_traits.hpp. This implementation
0042 // actually works with VC7.0, but other interactions seem to fail
0043 // when we use it.
0044 
0045 // is_class<> metafunction due to Paul Mensonides
0046 // (leavings@attbi.com). For more details:
0047 // http://groups.google.com/groups?hl=en&selm=000001c1cc83%24e154d5e0%247772e50c%40c161550a&rnum=1
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 // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
0095 # else // BOOST_IS_CLASS
0096 template <typename T>
0097 struct is_class_impl
0098 {
0099     BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_CLASS(T));
0100 };
0101 # endif // BOOST_IS_CLASS
0102 
0103 } // namespace detail
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 } // namespace boost
0113 
0114 #endif // BOOST_TT_IS_CLASS_HPP_INCLUDED