35 #ifndef EASTL_INTERNAL_TYPE_TRANFORMATIONS_H 36 #define EASTL_INTERNAL_TYPE_TRANFORMATIONS_H 77 struct add_signed<unsigned char>
78 {
typedef signed char type; };
80 #if (defined(CHAR_MAX) && defined(UCHAR_MAX) && (CHAR_MAX == UCHAR_MAX)) // If char is unsigned (which is usually not the case)... 82 struct add_signed<char>
83 {
typedef signed char type; };
87 struct add_signed<unsigned short>
88 {
typedef short type; };
91 struct add_signed<unsigned int>
92 {
typedef int type; };
95 struct add_signed<unsigned long>
96 {
typedef long type; };
99 struct add_signed<unsigned long long>
100 {
typedef long long type; };
102 #ifndef EA_WCHAR_T_NON_NATIVE // If wchar_t is a native type instead of simply a define to an existing type... 103 #if (defined(__WCHAR_MAX__) && (__WCHAR_MAX__ == 4294967295U)) // If wchar_t is a 32 bit unsigned value... 105 struct add_signed<wchar_t>
106 {
typedef int32_t type; };
107 #elif (defined(__WCHAR_MAX__) && (__WCHAR_MAX__ == 65535)) // If wchar_t is a 16 bit unsigned value... 109 struct add_signed<wchar_t>
110 {
typedef int16_t type; };
131 struct add_unsigned<signed char>
132 {
typedef unsigned char type; };
134 #if (defined(CHAR_MAX) && defined(SCHAR_MAX) && (CHAR_MAX == SCHAR_MAX)) // If char is signed (which is usually so)... 136 struct add_unsigned<char>
137 {
typedef unsigned char type; };
141 struct add_unsigned<short>
142 {
typedef unsigned short type; };
145 struct add_unsigned<int>
146 {
typedef unsigned int type; };
149 struct add_unsigned<long>
150 {
typedef unsigned long type; };
153 struct add_unsigned<long long>
154 {
typedef unsigned long long type; };
156 #ifndef EA_WCHAR_T_NON_NATIVE // If wchar_t is a native type instead of simply a define to an existing type... 157 #if (defined(__WCHAR_MAX__) && (__WCHAR_MAX__ == 2147483647)) // If wchar_t is a 32 bit signed value... 159 struct add_unsigned<wchar_t>
160 {
typedef uint32_t type; };
161 #elif (defined(__WCHAR_MAX__) && (__WCHAR_MAX__ == 32767)) // If wchar_t is a 16 bit signed value... 163 struct add_unsigned<wchar_t>
164 {
typedef uint16_t type; };
181 template <
typename T>
struct remove_cv_imp{};
182 template <
typename T>
struct remove_cv_imp<T*> {
typedef T unqualified_type; };
183 template <
typename T>
struct remove_cv_imp<const T*> {
typedef T unqualified_type; };
184 template <
typename T>
struct remove_cv_imp<volatile T*> {
typedef T unqualified_type; };
185 template <
typename T>
struct remove_cv_imp<const volatile T*> {
typedef T unqualified_type; };
187 template <
typename T>
struct remove_cv{
typedef typename remove_cv_imp<T*>::unqualified_type type; };
188 template <
typename T>
struct remove_cv<T&>{
typedef T& type; };
190 template <
typename T,
size_t N>
struct remove_cv<T const[N]> {
typedef T type[N]; };
191 template <
typename T,
size_t N>
struct remove_cv<T volatile[N]> {
typedef T type[N]; };
192 template <
typename T,
size_t N>
struct remove_cv<T const volatile[N]>{
typedef T type[N]; };
207 template <
typename T>
208 struct add_reference_impl{
typedef T& type; };
210 template <
typename T>
211 struct add_reference_impl<T&>{
typedef T& type; };
214 struct add_reference_impl<void>{
typedef void type; };
216 template <
typename T>
217 struct add_reference {
typedef typename add_reference_impl<T>::type type; };
223 #endif // Header include guard EA Standard Template Library.