30 #ifndef _EXT_TYPE_TRAITS
31 #define _EXT_TYPE_TRAITS 1
33 #pragma GCC system_header
38 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
40 _GLIBCXX_BEGIN_NAMESPACE_VERSION
43 template<
bool,
typename>
47 template<
typename _Tp>
48 struct __enable_if<true, _Tp>
49 {
typedef _Tp __type; };
53 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
54 struct __conditional_type
55 {
typedef _Iftrue __type; };
57 template<
typename _Iftrue,
typename _Iffalse>
58 struct __conditional_type<false, _Iftrue, _Iffalse>
59 {
typedef _Iffalse __type; };
63 template<
typename _Tp>
67 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
70 typedef typename __if_type::__type __type;
74 struct __add_unsigned<char>
75 {
typedef unsigned char __type; };
78 struct __add_unsigned<signed char>
79 {
typedef unsigned char __type; };
82 struct __add_unsigned<short>
83 {
typedef unsigned short __type; };
86 struct __add_unsigned<int>
87 {
typedef unsigned int __type; };
90 struct __add_unsigned<long>
91 {
typedef unsigned long __type; };
94 struct __add_unsigned<long long>
95 {
typedef unsigned long long __type; };
99 struct __add_unsigned<bool>;
102 struct __add_unsigned<wchar_t>;
106 template<
typename _Tp>
107 struct __remove_unsigned
110 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
113 typedef typename __if_type::__type __type;
117 struct __remove_unsigned<char>
118 {
typedef signed char __type; };
121 struct __remove_unsigned<unsigned char>
122 {
typedef signed char __type; };
125 struct __remove_unsigned<unsigned short>
126 {
typedef short __type; };
129 struct __remove_unsigned<unsigned int>
130 {
typedef int __type; };
133 struct __remove_unsigned<unsigned long>
134 {
typedef long __type; };
137 struct __remove_unsigned<unsigned long long>
138 {
typedef long long __type; };
142 struct __remove_unsigned<bool>;
145 struct __remove_unsigned<wchar_t>;
149 template<
typename _Type>
151 __is_null_pointer(_Type* __ptr)
152 {
return __ptr == 0; }
154 template<
typename _Type>
156 __is_null_pointer(_Type)
161 template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
163 {
typedef double __type; };
168 template<
typename _Tp>
169 struct __promote<_Tp, false>
173 struct __promote<long double>
174 {
typedef long double __type; };
177 struct __promote<double>
178 {
typedef double __type; };
181 struct __promote<float>
182 {
typedef float __type; };
184 template<
typename _Tp,
typename _Up,
185 typename _Tp2 =
typename __promote<_Tp>::__type,
186 typename _Up2 =
typename __promote<_Up>::__type>
189 typedef __typeof__(_Tp2() + _Up2()) __type;
192 template<typename _Tp, typename _Up, typename _Vp,
193 typename _Tp2 = typename __promote<_Tp>::__type,
194 typename _Up2 = typename __promote<_Up>::__type,
195 typename _Vp2 = typename __promote<_Vp>::__type>
198 typedef __typeof__(_Tp2() + _Up2() + _Vp2()) __type;
201 template<typename _Tp, typename _Up, typename _Vp, typename _Wp,
202 typename _Tp2 = typename __promote<_Tp>::__type,
203 typename _Up2 = typename __promote<_Up>::__type,
204 typename _Vp2 = typename __promote<_Vp>::__type,
205 typename _Wp2 = typename __promote<_Wp>::__type>
208 typedef __typeof__(_Tp2() + _Up2() + _Vp2() + _Wp2()) __type;
211 _GLIBCXX_END_NAMESPACE_VERSION