is_class.hpp
Go to the documentation of this file.
1 // (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
2 // Hinnant & John Maddock 2000-2003.
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 
10 #ifndef BOOST_TT_IS_CLASS_HPP_INCLUDED
11 #define BOOST_TT_IS_CLASS_HPP_INCLUDED
12 
16 #ifndef BOOST_IS_CLASS
18 
19 #ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
21 #else
27 #endif
28 
29 #endif // BOOST_IS_CLASS
30 
31 namespace boost {
32 
33 namespace detail {
34 
35 #ifndef BOOST_IS_CLASS
36 #ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
37 
38 // This is actually the conforming implementation which works with
39 // abstract classes. However, enough compilers have trouble with
40 // it that most will use the one in
41 // boost/type_traits/object_traits.hpp. This implementation
42 // actually works with VC7.0, but other interactions seem to fail
43 // when we use it.
44 
45 // is_class<> metafunction due to Paul Mensonides
46 // (leavings@attbi.com). For more details:
47 // http://groups.google.com/groups?hl=en&selm=000001c1cc83%24e154d5e0%247772e50c%40c161550a&rnum=1
48 #if defined(__GNUC__) && !defined(__EDG_VERSION__)
49 
50 template <class U> ::boost::type_traits::yes_type is_class_tester(void(U::*)(void));
51 template <class U> ::boost::type_traits::no_type is_class_tester(...);
52 
53 template <typename T>
54 struct is_class_impl
55 {
56 
57  BOOST_STATIC_CONSTANT(bool, value =
58  sizeof(is_class_tester<T>(0)) == sizeof(::boost::type_traits::yes_type)
60  );
61 };
62 
63 #else
64 
65 template <typename T>
66 struct is_class_impl
67 {
68  template <class U> static ::boost::type_traits::yes_type is_class_tester(void(U::*)(void));
69  template <class U> static ::boost::type_traits::no_type is_class_tester(...);
70 
71  BOOST_STATIC_CONSTANT(bool, value =
72  sizeof(is_class_tester<T>(0)) == sizeof(::boost::type_traits::yes_type)
74  );
75 };
76 
77 #endif
78 
79 #else
80 
81 template <typename T>
83 {
84  BOOST_STATIC_CONSTANT(bool, value =
85  ! ::boost::is_union<T>::value >::value
91  );
92 };
93 
94 # endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
95 # else // BOOST_IS_CLASS
96 template <typename T>
97 struct is_class_impl
98 {
99  BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_CLASS(T));
100 };
101 # endif // BOOST_IS_CLASS
102 
103 } // namespace detail
104 
105 template <class T> struct is_class : public integral_constant<bool, ::boost::detail::is_class_impl<T>::value> {};
106 # ifdef __EDG_VERSION__
107 template <class T> struct is_class<const T> : public is_class<T>{};
108 template <class T> struct is_class<const volatile T> : public is_class<T>{};
109 template <class T> struct is_class<volatile T> : public is_class<T>{};
110 # endif
111 
112 } // namespace boost
113 
114 #endif // BOOST_TT_IS_CLASS_HPP_INCLUDED
T
T
Definition: mem_fn_cc.hpp:25
integral_constant.hpp
boost::is_class
Definition: is_class.hpp:105
is_function.hpp
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
is_reference.hpp
boost::detail::is_class_impl
Definition: is_class.hpp:82
boost::is_function
Definition: is_function.hpp:95
intrinsics.hpp
yes_no_type.hpp
is_scalar.hpp
boost::is_scalar
Definition: is_scalar.hpp:21
boost::is_void
Definition: is_void.hpp:17
boost::is_reference
Definition: is_reference.hpp:20
is_array.hpp
is_void.hpp
boost::detail::is_class_impl::BOOST_STATIC_CONSTANT
BOOST_STATIC_CONSTANT(bool, value=! ::boost::is_union< T >::value >::value &&! ::boost::is_scalar< T >::value &&! ::boost::is_array< T >::value &&! ::boost::is_reference< T >::value &&! ::boost::is_void< T >::value &&! ::boost::is_function< T >::value)
config.hpp
boost::is_union
Definition: is_union.hpp:22
is_union.hpp
boost::type_traits::yes_type
char yes_type
Definition: yes_no_type.hpp:17
boost::is_array
Definition: is_array.hpp:25
boost::integral_constant
Definition: integral_constant.hpp:52
boost::move_detail::yes_type
char yes_type
Definition: meta_utils.hpp:74
boost::type_traits::no_type
Definition: yes_no_type.hpp:18


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:40:00