29 #ifndef _EXT_TYPE_TRAITS
30 #define _EXT_TYPE_TRAITS 1
32 #pragma GCC system_header
37 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
42 template<
bool,
typename>
46 template<
typename _Tp>
47 struct __enable_if<true, _Tp>
48 {
typedef _Tp __type; };
52 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
53 struct __conditional_type
54 {
typedef _Iftrue __type; };
56 template<
typename _Iftrue,
typename _Iffalse>
57 struct __conditional_type<false, _Iftrue, _Iffalse>
58 {
typedef _Iffalse __type; };
62 template<
typename _Tp>
66 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
69 typedef typename __if_type::__type __type;
73 struct __add_unsigned<char>
74 {
typedef unsigned char __type; };
77 struct __add_unsigned<signed char>
78 {
typedef unsigned char __type; };
81 struct __add_unsigned<short>
82 {
typedef unsigned short __type; };
85 struct __add_unsigned<int>
86 {
typedef unsigned int __type; };
89 struct __add_unsigned<long>
90 {
typedef unsigned long __type; };
93 struct __add_unsigned<long long>
94 {
typedef unsigned long long __type; };
98 struct __add_unsigned<bool>;
101 struct __add_unsigned<wchar_t>;
105 template<
typename _Tp>
106 struct __remove_unsigned
109 typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
112 typedef typename __if_type::__type __type;
116 struct __remove_unsigned<char>
117 {
typedef signed char __type; };
120 struct __remove_unsigned<unsigned char>
121 {
typedef signed char __type; };
124 struct __remove_unsigned<unsigned short>
125 {
typedef short __type; };
128 struct __remove_unsigned<unsigned int>
129 {
typedef int __type; };
132 struct __remove_unsigned<unsigned long>
133 {
typedef long __type; };
136 struct __remove_unsigned<unsigned long long>
137 {
typedef long long __type; };
141 struct __remove_unsigned<bool>;
144 struct __remove_unsigned<wchar_t>;
148 template<
typename _Type>
150 __is_null_pointer(_Type* __ptr)
151 {
return __ptr == 0; }
153 template<
typename _Type>
155 __is_null_pointer(_Type)
160 template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
162 {
typedef double __type; };
167 template<
typename _Tp>
168 struct __promote<_Tp, false>
172 struct __promote<long double>
173 {
typedef long double __type; };
176 struct __promote<double>
177 {
typedef double __type; };
180 struct __promote<float>
181 {
typedef float __type; };
183 template<
typename _Tp,
typename _Up,
184 typename _Tp2 =
typename __promote<_Tp>::__type,
185 typename _Up2 =
typename __promote<_Up>::__type>
188 typedef __typeof__(_Tp2() + _Up2()) __type;
191 template<typename _Tp, typename _Up, typename _Vp,
192 typename _Tp2 = typename __promote<_Tp>::__type,
193 typename _Up2 = typename __promote<_Up>::__type,
194 typename _Vp2 = typename __promote<_Vp>::__type>
197 typedef __typeof__(_Tp2() + _Up2() + _Vp2()) __type;
200 template<typename _Tp, typename _Up, typename _Vp, typename _Wp,
201 typename _Tp2 = typename __promote<_Tp>::__type,
202 typename _Up2 = typename __promote<_Up>::__type,
203 typename _Vp2 = typename __promote<_Vp>::__type,
204 typename _Wp2 = typename __promote<_Wp>::__type>
207 typedef __typeof__(_Tp2() + _Up2() + _Vp2() + _Wp2()) __type;
210 _GLIBCXX_END_NAMESPACE_VERSION
GNU extensions for public use.