make_unsigned.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_UNSIGNED_HPP_INCLUDED
10 #define BOOST_TT_MAKE_UNSIGNED_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_unsigned 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_unsigned must not be the type bool");
33 
34  typedef typename remove_cv<T>::type t_no_cv;
35  typedef typename conditional<
40  T,
41  typename conditional<
46  typename conditional<
48  unsigned char,
49  typename conditional<
51  unsigned short,
52  typename conditional<
54  unsigned int,
55  typename conditional<
57  unsigned long,
58 #if defined(BOOST_HAS_LONG_LONG)
59 #ifdef BOOST_HAS_INT128
60  typename conditional<
61  sizeof(t_no_cv) == sizeof(boost::ulong_long_type),
62  boost::ulong_long_type,
63  boost::uint128_type
64  >::type
65 #else
66  boost::ulong_long_type
67 #endif
68 #elif defined(BOOST_HAS_MS_INT64)
69  unsigned __int64
70 #else
71  unsigned long
72 #endif
73  >::type
74  >::type
75  >::type
76  >::type,
77  // Not a regular integer type:
78  typename conditional<
79  sizeof(t_no_cv) == sizeof(unsigned char),
80  unsigned char,
81  typename conditional<
82  sizeof(t_no_cv) == sizeof(unsigned short),
83  unsigned short,
84  typename conditional<
85  sizeof(t_no_cv) == sizeof(unsigned int),
86  unsigned int,
87  typename conditional<
88  sizeof(t_no_cv) == sizeof(unsigned long),
89  unsigned long,
90 #if defined(BOOST_HAS_LONG_LONG)
91 #ifdef BOOST_HAS_INT128
92  typename conditional<
93  sizeof(t_no_cv) == sizeof(boost::ulong_long_type),
94  boost::ulong_long_type,
95  boost::uint128_type
96  >::type
97 #else
98  boost::ulong_long_type
99 #endif
100 #elif defined(BOOST_HAS_MS_INT64)
101  unsigned __int64
102 #else
103  unsigned long
104 #endif
105  >::type
106  >::type
107  >::type
108  >::type
109  >::type
111 
112  // Add back any const qualifier:
113  typedef typename conditional<
116  base_integer_type
118 public:
119  // Add back any volatile qualifier:
120  typedef typename conditional<
123  const_base_integer_type
124  >::type type;
125 };
126 
127 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
128 
129  template <class T> using make_unsigned_t = typename make_unsigned<T>::type;
130 
131 #endif
132 
133 } // namespace boost
134 
135 #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
136 
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
BOOST_STATIC_ASSERT_MSG((::boost::is_integral< T >::value||::boost::is_enum< T >::value),"The template argument to make_unsigned must be an integer or enum type.")
GLfloat value
conditional< is_volatile< T >::value, typename add_volatile< const_base_integer_type >::type, const_base_integer_type >::type type
conditional< (::boost::is_unsigned< 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, signed char >::value, unsigned char, typename conditional< is_same< t_no_cv, short >::value, unsigned short, typename conditional< is_same< t_no_cv, int >::value, unsigned int, typename conditional< is_same< t_no_cv, long >::value, unsigned long, unsigned long >::type >::type >::type >::type, typename conditional< sizeof(t_no_cv)==sizeof(unsigned char), unsigned char, typename conditional< sizeof(t_no_cv)==sizeof(unsigned short), unsigned short, typename conditional< sizeof(t_no_cv)==sizeof(unsigned int), unsigned int, typename conditional< sizeof(t_no_cv)==sizeof(unsigned long), unsigned long, unsigned long >::type >::type >::type >::type >::type >::type base_integer_type
typename make_unsigned< T >::type make_unsigned_t
conditional< is_const< T >::value, typename add_const< base_integer_type >::type, base_integer_type >::type const_base_integer_type
remove_cv< T >::type t_no_cv


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:21