make_signed.hpp
Go to the documentation of this file.
1 
2 // (C) Copyright John Maddock 2007.
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 #ifndef BOOST_TT_MAKE_SIGNED_HPP_INCLUDED
10 #define BOOST_TT_MAKE_SIGNED_HPP_INCLUDED
11 
23 #include <boost/static_assert.hpp>
24 
25 namespace boost {
26 
27 template <class T>
29 {
30 private:
31  BOOST_STATIC_ASSERT_MSG(( ::boost::is_integral<T>::value || ::boost::is_enum<T>::value), "The template argument to make_signed must be an integer or enum type.");
32  BOOST_STATIC_ASSERT_MSG(!(::boost::is_same<typename remove_cv<T>::type, bool>::value), "The template argument to make_signed must not be the type bool.");
33 
34  typedef typename remove_cv<T>::type t_no_cv;
35  typedef typename conditional<
41  T,
42  typename conditional<
47  typename conditional<
49  signed char,
50  typename conditional<
52  signed short,
53  typename conditional<
55  int,
56  typename conditional<
58  long,
59 #if defined(BOOST_HAS_LONG_LONG)
60 #ifdef BOOST_HAS_INT128
61  typename conditional<
62  sizeof(t_no_cv) == sizeof(boost::long_long_type),
63  boost::long_long_type,
64  boost::int128_type
65  >::type
66 #else
67  boost::long_long_type
68 #endif
69 #elif defined(BOOST_HAS_MS_INT64)
70  __int64
71 #else
72  long
73 #endif
74  >::type
75  >::type
76  >::type
77  >::type,
78  // Not a regular integer type:
79  typename conditional<
80  sizeof(t_no_cv) == sizeof(unsigned char),
81  signed char,
82  typename conditional<
83  sizeof(t_no_cv) == sizeof(unsigned short),
84  signed short,
85  typename conditional<
86  sizeof(t_no_cv) == sizeof(unsigned int),
87  int,
88  typename conditional<
89  sizeof(t_no_cv) == sizeof(unsigned long),
90  long,
91 #if defined(BOOST_HAS_LONG_LONG)
92 #ifdef BOOST_HAS_INT128
93  typename conditional<
94  sizeof(t_no_cv) == sizeof(boost::long_long_type),
95  boost::long_long_type,
96  boost::int128_type
97  >::type
98 #else
99  boost::long_long_type
100 #endif
101 #elif defined(BOOST_HAS_MS_INT64)
102  __int64
103 #else
104  long
105 #endif
106  >::type
107  >::type
108  >::type
109  >::type
110  >::type
112 
113  // Add back any const qualifier:
114  typedef typename conditional<
119 public:
120  // Add back any volatile qualifier:
121  typedef typename conditional<
126 };
127 
128 } // namespace boost
129 
130 #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
131 
T
T
Definition: mem_fn_cc.hpp:25
conditional.hpp
boost::make_signed::t_no_cv
remove_cv< T >::type t_no_cv
Definition: make_signed.hpp:34
static_assert.hpp
remove_cv.hpp
is_unsigned.hpp
boost::make_signed::BOOST_STATIC_ASSERT_MSG
BOOST_STATIC_ASSERT_MSG((::boost::is_integral< T >::value||::boost::is_enum< T >::value), "The template argument to make_signed must be an integer or enum type.")
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::is_enum
Definition: is_enum.hpp:148
is_integral.hpp
boost::is_same
Definition: type_traits/is_same.hpp:29
boost::add_const::type
const T type
Definition: add_const.hpp:32
boost::is_const
Definition: is_const.hpp:37
add_const.hpp
is_same.hpp
boost::conditional
Definition: conditional.hpp:14
is_enum.hpp
boost::make_signed::type
conditional< is_volatile< T >::value, typename add_volatile< const_base_integer_type >::type, const_base_integer_type >::type type
Definition: make_signed.hpp:125
is_const.hpp
is_volatile.hpp
boost::make_signed::const_base_integer_type
conditional< is_const< T >::value, typename add_const< base_integer_type >::type, base_integer_type >::type const_base_integer_type
Definition: make_signed.hpp:118
boost::is_volatile
Definition: is_volatile.hpp:37
add_volatile.hpp
boost::make_signed
Definition: make_signed.hpp:28
is_signed.hpp
boost::remove_cv::type
T type
Definition: remove_cv.hpp:21
boost::make_signed::base_integer_type
conditional<(::boost::is_signed< T >::value &&::boost::is_integral< T >::value &&! ::boost::is_same< t_no_cv, char >::value &&! ::boost::is_same< t_no_cv, wchar_t >::value &&! ::boost::is_same< t_no_cv, bool >::value), T, typename conditional<(::boost::is_integral< T >::value &&! ::boost::is_same< t_no_cv, char >::value &&! ::boost::is_same< t_no_cv, wchar_t >::value &&! ::boost::is_same< t_no_cv, bool >::value), typename conditional< is_same< t_no_cv, unsigned char >::value, signed char, typename conditional< is_same< t_no_cv, unsigned short >::value, signed short, typename conditional< is_same< t_no_cv, unsigned int >::value, int, typename conditional< is_same< t_no_cv, unsigned long >::value, long, long >::type >::type >::type >::type, typename conditional< sizeof(t_no_cv)==sizeof(unsigned char), signed char, typename conditional< sizeof(t_no_cv)==sizeof(unsigned short), signed short, typename conditional< sizeof(t_no_cv)==sizeof(unsigned int), int, typename conditional< sizeof(t_no_cv)==sizeof(unsigned long), long, long >::type >::type >::type >::type >::type >::type base_integer_type
Definition: make_signed.hpp:111
boost::add_volatile::type
T volatile type
Definition: add_volatile.hpp:30
boost::integral_constant
Definition: integral_constant.hpp:52
boost::is_signed
Definition: is_signed.hpp:79
boost::is_integral
Definition: is_integral.hpp:22


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