is_signed.hpp
Go to the documentation of this file.
1 
2 // (C) Copyright John Maddock 2005.
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_SIGNED_HPP_INCLUDED
11 #define BOOST_TT_IS_SIGNED_HPP_INCLUDED
12 
16 #include <climits>
17 
18 namespace boost {
19 
20 #if !defined( __CODEGEARC__ )
21 
22 #if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1310) && \
23  !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) &&\
24  !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
25 
26 namespace detail{
27 
28 template <class T>
30 {
31  //
32  // Note that we cannot use BOOST_STATIC_CONSTANT here, using enum's
33  // rather than "real" static constants simply doesn't work or give
34  // the correct answer.
35  //
36  typedef typename remove_cv<T>::type no_cv_t;
37  static const no_cv_t minus_one = (static_cast<no_cv_t>(-1));
38  static const no_cv_t zero = (static_cast<no_cv_t>(0));
39 };
40 
41 template <class T>
43 {
44  typedef typename remove_cv<T>::type no_cv_t;
46 };
47 
48 template <bool integral_type>
50 {
51  template <class T>
52  struct rebind
53  {
55  };
56 };
57 
58 template <>
60 {
61  template <class T>
62  struct rebind
63  {
64  typedef false_type type;
65  };
66 };
67 
68 template <class T>
70 {
71  typedef ::boost::detail::is_signed_select_helper< ::boost::is_integral<T>::value || ::boost::is_enum<T>::value> selector;
72  typedef typename selector::template rebind<T> binder;
73  typedef typename binder::type type;
74  BOOST_STATIC_CONSTANT(bool, value = type::value);
75 };
76 
77 }
78 
79 template <class T> struct is_signed : public integral_constant<bool, boost::detail::is_signed_impl<T>::value> {};
80 
81 #else
82 
83 template <class T> struct is_signed : public false_type{};
84 
85 #endif
86 
87 #else //defined( __CODEGEARC__ )
88  template <class T> struct is_signed : public integral_constant<bool, __is_signed(T)>{};
89 #endif
90 
91 template <> struct is_signed<signed char> : public true_type{};
92 template <> struct is_signed<const signed char> : public true_type{};
93 template <> struct is_signed<volatile signed char> : public true_type{};
94 template <> struct is_signed<const volatile signed char> : public true_type{};
95 template <> struct is_signed<short> : public true_type{};
96 template <> struct is_signed<const short> : public true_type{};
97 template <> struct is_signed<volatile short> : public true_type{};
98 template <> struct is_signed<const volatile short> : public true_type{};
99 template <> struct is_signed<int> : public true_type{};
100 template <> struct is_signed<const int> : public true_type{};
101 template <> struct is_signed<volatile int> : public true_type{};
102 template <> struct is_signed<const volatile int> : public true_type{};
103 template <> struct is_signed<long> : public true_type{};
104 template <> struct is_signed<const long> : public true_type{};
105 template <> struct is_signed<volatile long> : public true_type{};
106 template <> struct is_signed<const volatile long> : public true_type{};
107 
108 template <> struct is_signed<unsigned char> : public false_type{};
109 template <> struct is_signed<const unsigned char> : public false_type{};
110 template <> struct is_signed<volatile unsigned char> : public false_type{};
111 template <> struct is_signed<const volatile unsigned char> : public false_type{};
112 template <> struct is_signed<unsigned short> : public false_type{};
113 template <> struct is_signed<const unsigned short> : public false_type{};
114 template <> struct is_signed<volatile unsigned short> : public false_type{};
115 template <> struct is_signed<const volatile unsigned short> : public false_type{};
116 template <> struct is_signed<unsigned int> : public false_type{};
117 template <> struct is_signed<const unsigned int> : public false_type{};
118 template <> struct is_signed<volatile unsigned int> : public false_type{};
119 template <> struct is_signed<const volatile unsigned int> : public false_type{};
120 template <> struct is_signed<unsigned long> : public false_type{};
121 template <> struct is_signed<const unsigned long> : public false_type{};
122 template <> struct is_signed<volatile unsigned long> : public false_type{};
123 template <> struct is_signed<const volatile unsigned long> : public false_type{};
124 #ifdef BOOST_HAS_LONG_LONG
125 template <> struct is_signed< ::boost::long_long_type> : public true_type{};
126 template <> struct is_signed<const ::boost::long_long_type> : public true_type{};
127 template <> struct is_signed<volatile ::boost::long_long_type> : public true_type{};
128 template <> struct is_signed<const volatile ::boost::long_long_type> : public true_type{};
129 
130 template <> struct is_signed< ::boost::ulong_long_type> : public false_type{};
131 template <> struct is_signed<const ::boost::ulong_long_type> : public false_type{};
132 template <> struct is_signed<volatile ::boost::ulong_long_type> : public false_type{};
133 template <> struct is_signed<const volatile ::boost::ulong_long_type> : public false_type{};
134 #endif
135 #if defined(CHAR_MIN)
136 #if CHAR_MIN != 0
137 template <> struct is_signed<char> : public true_type{};
138 template <> struct is_signed<const char> : public true_type{};
139 template <> struct is_signed<volatile char> : public true_type{};
140 template <> struct is_signed<const volatile char> : public true_type{};
141 #else
142 template <> struct is_signed<char> : public false_type{};
143 template <> struct is_signed<const char> : public false_type{};
144 template <> struct is_signed<volatile char> : public false_type{};
145 template <> struct is_signed<const volatile char> : public false_type{};
146 #endif
147 #endif
148 #if defined(WCHAR_MIN) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
149 #if WCHAR_MIN != 0
150 template <> struct is_signed<wchar_t> : public true_type{};
151 template <> struct is_signed<const wchar_t> : public true_type{};
152 template <> struct is_signed<volatile wchar_t> : public true_type{};
153 template <> struct is_signed<const volatile wchar_t> : public true_type{};
154 #else
155 template <> struct is_signed<wchar_t> : public false_type{};
156 template <> struct is_signed<const wchar_t> : public false_type{};
157 template <> struct is_signed<volatile wchar_t> : public false_type{};
158 template <> struct is_signed<const volatile wchar_t> : public false_type{};
159 #endif
160 #endif
161 } // namespace boost
162 
163 #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
boost::detail::is_signed_values::no_cv_t
remove_cv< T >::type no_cv_t
Definition: is_signed.hpp:36
remove_cv.hpp
boost::detail::is_signed_select_helper
Definition: is_signed.hpp:49
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::detail::is_signed_impl::binder
selector::template rebind< T > binder
Definition: is_signed.hpp:72
boost::is_enum
Definition: is_enum.hpp:148
boost::detail::is_signed_values::minus_one
static const no_cv_t minus_one
Definition: is_signed.hpp:37
boost::detail::is_signed_impl
Definition: is_signed.hpp:69
is_integral.hpp
boost::detail::is_signed_values
Definition: is_signed.hpp:29
boost::detail::is_signed_helper
Definition: is_signed.hpp:42
boost::detail::is_signed_values::zero
static const no_cv_t zero
Definition: is_signed.hpp:38
boost::detail::is_signed_select_helper::rebind::type
is_signed_helper< T > type
Definition: is_signed.hpp:54
boost::false_type
integral_constant< bool, false > false_type
Definition: integral_constant.hpp:102
boost::detail::is_signed_select_helper< false >::rebind::type
false_type type
Definition: is_signed.hpp:64
is_enum.hpp
boost::detail::is_signed_helper::no_cv_t
remove_cv< T >::type no_cv_t
Definition: is_signed.hpp:44
boost::detail::is_signed_impl::selector
::boost::detail::is_signed_select_helper< ::boost::is_integral< T >::value||::boost::is_enum< T >::value > selector
Definition: is_signed.hpp:71
boost::detail::is_signed_select_helper::rebind
Definition: is_signed.hpp:52
boost::detail::is_signed_impl::type
binder::type type
Definition: is_signed.hpp:73
boost::true_type
integral_constant< bool, true > true_type
Definition: integral_constant.hpp:101
boost::remove_cv::type
T type
Definition: remove_cv.hpp:21
boost::detail::is_signed_impl::BOOST_STATIC_CONSTANT
BOOST_STATIC_CONSTANT(bool, value=type::value)
boost::detail::is_signed_helper::BOOST_STATIC_CONSTANT
BOOST_STATIC_CONSTANT(bool, value=(!(::boost::detail::is_signed_values< T >::minus_one > boost::detail::is_signed_values< T >::zero)))
boost::integral_constant< bool, false >
boost::is_signed
Definition: is_signed.hpp:79


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