is_polymorphic.hpp
Go to the documentation of this file.
1 // (C) Copyright John Maddock 2000.
2 // Use, modification and distribution are subject to the Boost Software License,
3 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt).
5 //
6 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
7 
8 #ifndef BOOST_TT_IS_POLYMORPHIC_HPP
9 #define BOOST_TT_IS_POLYMORPHIC_HPP
10 
13 #ifndef BOOST_IS_POLYMORPHIC
15 #endif
17 
18 #if defined(BOOST_MSVC) && (BOOST_MSVC >= 1700)
19 #pragma warning(push)
20 #pragma warning(disable:4250)
21 #endif
22 
23 namespace boost{
24 
25 #ifndef BOOST_IS_POLYMORPHIC
26 
27 namespace detail{
28 
29 template <class T>
31 {
32 # if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) // CWPro7 should return false always.
33  typedef char d1, (&d2)[2];
34 # else
35  struct d1 : public T
36  {
37  d1();
38 # if !defined(__GNUC__) // this raises warnings with some classes, and buys nothing with GCC
39  ~d1()throw();
40 # endif
41  char padding[256];
42  private:
43  // keep some picky compilers happy:
44  d1(const d1&);
45  d1& operator=(const d1&);
46  };
47  struct d2 : public T
48  {
49  d2();
50  virtual ~d2()throw();
51 # if !defined(BOOST_MSVC) && !defined(__ICL)
52  // for some reason this messes up VC++ when T has virtual bases,
53  // probably likewise for compilers that use the same ABI:
54  struct unique{};
55  virtual void unique_name_to_boost5487629(unique*);
56 # endif
57  char padding[256];
58  private:
59  // keep some picky compilers happy:
60  d2(const d2&);
61  d2& operator=(const d2&);
62  };
63 # endif
64  BOOST_STATIC_CONSTANT(bool, value = (sizeof(d2) == sizeof(d1)));
65 };
66 
67 template <class T> struct is_polymorphic_imp1<T const> : public is_polymorphic_imp1<T>{};
68 template <class T> struct is_polymorphic_imp1<T const volatile> : public is_polymorphic_imp1<T>{};
69 template <class T> struct is_polymorphic_imp1<T volatile> : public is_polymorphic_imp1<T>{};
70 
71 template <class T>
73 {
74  BOOST_STATIC_CONSTANT(bool, value = false);
75 };
76 
77 template <bool is_class>
79 {
80  template <class T>
81  struct rebind
82  {
84  };
85 };
86 
87 template <>
89 {
90  template <class T>
91  struct rebind
92  {
94  };
95 };
96 
97 template <class T>
99 {
101  typedef typename selector::template rebind<T> binder;
102  typedef typename binder::type imp_type;
103  BOOST_STATIC_CONSTANT(bool, value = imp_type::value);
104 };
105 
106 } // namespace detail
107 
108 template <class T> struct is_polymorphic : public integral_constant<bool, ::boost::detail::is_polymorphic_imp<T>::value> {};
109 
110 #else // BOOST_IS_POLYMORPHIC
111 
112 template <class T> struct is_polymorphic : public integral_constant<bool, BOOST_IS_POLYMORPHIC(T)> {};
113 
114 #endif
115 
116 } // namespace boost
117 
118 #if defined(BOOST_MSVC) && (BOOST_MSVC >= 1700)
119 #pragma warning(pop)
120 #endif
121 
122 #endif
boost::is_polymorphic
Definition: is_polymorphic.hpp:108
T
T
Definition: mem_fn_cc.hpp:25
boost::detail::is_polymorphic_imp2::BOOST_STATIC_CONSTANT
BOOST_STATIC_CONSTANT(bool, value=false)
boost::detail::is_polymorphic_imp1::d1
Definition: is_polymorphic.hpp:35
boost::detail::is_polymorphic_imp
Definition: is_polymorphic.hpp:98
integral_constant.hpp
boost::detail::is_polymorphic_imp1::d2::unique_name_to_boost5487629
virtual void unique_name_to_boost5487629(unique *)
boost::detail::is_polymorphic_selector::rebind
Definition: is_polymorphic.hpp:81
boost::detail::is_polymorphic_imp1::d1::d1
d1()
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::detail::is_polymorphic_selector
Definition: is_polymorphic.hpp:78
boost::detail::is_polymorphic_imp1
Definition: is_polymorphic.hpp:30
boost::detail::is_polymorphic_imp1::d2::padding
char padding[256]
Definition: is_polymorphic.hpp:57
boost::detail::is_polymorphic_imp1::BOOST_STATIC_CONSTANT
BOOST_STATIC_CONSTANT(bool, value=(sizeof(d2)==sizeof(d1)))
boost::detail::is_polymorphic_imp::BOOST_STATIC_CONSTANT
BOOST_STATIC_CONSTANT(bool, value=imp_type::value)
intrinsics.hpp
is_class.hpp
boost::detail::is_polymorphic_selector< true >::rebind::type
is_polymorphic_imp1< T > type
Definition: is_polymorphic.hpp:93
boost::detail::is_polymorphic_imp1::d2::operator=
d2 & operator=(const d2 &)
boost::detail::is_polymorphic_imp::imp_type
binder::type imp_type
Definition: is_polymorphic.hpp:102
boost::detail::is_polymorphic_imp1::d2::unique
Definition: is_polymorphic.hpp:54
boost::detail::is_polymorphic_imp2
Definition: is_polymorphic.hpp:72
boost::detail::is_polymorphic_imp1::d2::~d2
virtual ~d2()
boost::detail::is_polymorphic_imp1::d1::padding
char padding[256]
Definition: is_polymorphic.hpp:41
boost::detail::is_polymorphic_imp::binder
selector::template rebind< T > binder
Definition: is_polymorphic.hpp:101
boost::detail::is_polymorphic_imp1::d1::~d1
~d1()
boost::detail::is_polymorphic_selector::rebind::type
is_polymorphic_imp2< T > type
Definition: is_polymorphic.hpp:83
boost::detail::is_polymorphic_imp1::d1::operator=
d1 & operator=(const d1 &)
boost::detail::is_polymorphic_imp1::d2::d2
d2()
boost::detail::is_polymorphic_imp::selector
is_polymorphic_selector< ::boost::is_class< T >::value > selector
Definition: is_polymorphic.hpp:100
workaround.hpp
boost::detail::is_polymorphic_imp1::d2
Definition: is_polymorphic.hpp:47
boost::integral_constant
Definition: integral_constant.hpp:52


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