34#ifndef _RWSTD_TYPETRAITS_H_INCLUDED
35#define _RWSTD_TYPETRAITS_H_INCLUDED
43template <
class T, T v>
44struct __rw_integral_constant
48 using type = integral_constant;
50 constexpr operator value_type()
const noexcept {
return value; }
51 constexpr value_type operator()()
const noexcept {
return value; }
54using __rw_true_type = __rw_integral_constant<bool, true>;
55using __rw_false_type = __rw_integral_constant<bool, false>;
57template <
class _TypeT>
60 typedef _TypeT _C_type;
64template <
class _TypeT>
65struct __rw_is_const<const _TypeT>
67 typedef _TypeT _C_type;
71template <
class _TypeT>
72struct __rw_is_volatile
74 typedef _TypeT _C_type;
78template <
class _TypeT>
79struct __rw_is_volatile<volatile _TypeT>
81 typedef _TypeT _C_type;
86template <
class _TypeT>
87struct __rw_is_cv_qualified
89 typedef _TypeT _C_type;
93template <
class _TypeT>
94struct __rw_is_cv_qualified<const _TypeT>
96 typedef _TypeT _C_type;
100template <
class _TypeT>
101struct __rw_is_cv_qualified<volatile _TypeT>
103 typedef _TypeT _C_type;
107template <
class _TypeT>
108struct __rw_is_cv_qualified<const volatile _TypeT>
110 typedef _TypeT _C_type;
115template <
class _TypeT>
116struct __rw_is_pointer
118 typedef _TypeT _C_type;
122template <
class _TypeT>
123struct __rw_is_pointer<_TypeT*>
125 typedef _TypeT _C_type;
130template <
class _TypeT>
131struct __rw_is_reference
133 typedef _TypeT _C_type;
137template <
class _TypeT>
138struct __rw_is_reference<_TypeT&>
140 typedef _TypeT _C_type;
144template <
class _TypeT>
145struct __rw_is_reference<_TypeT&&>
147 typedef _TypeT _C_type;
151template <
class _TypeT>
152struct __rw_is_fundamental
154 enum { _C_val = __rw_is_pointer<_TypeT>::_C_val };
158struct __rw_is_fundamental<unsigned char> {
enum { _C_val = 1 }; };
161struct __rw_is_fundamental<signed char> {
enum { _C_val = 1 }; };
164struct __rw_is_fundamental<char> {
enum { _C_val = 1 }; };
167struct __rw_is_fundamental<unsigned short> {
enum { _C_val = 1 }; };
170struct __rw_is_fundamental<signed short> {
enum { _C_val = 1 }; };
173struct __rw_is_fundamental<unsigned int> {
enum { _C_val = 1 }; };
176struct __rw_is_fundamental<signed int> {
enum { _C_val = 1 }; };
179struct __rw_is_fundamental<unsigned long> {
enum { _C_val = 1 }; };
182struct __rw_is_fundamental<signed long> {
enum { _C_val = 1 }; };
184#ifdef _RWSTD_LONG_LONG
187struct __rw_is_fundamental<unsigned
_RWSTD_LONG_LONG> {
enum { _C_val = 1 }; };
190struct __rw_is_fundamental<signed
_RWSTD_LONG_LONG> {
enum { _C_val = 1 }; };
195struct __rw_is_fundamental<float> {
enum { _C_val = 1 }; };
198struct __rw_is_fundamental<double> {
enum { _C_val = 1 }; };
200#ifndef _RWSTD_NO_LONG_DOUBLE
203struct __rw_is_fundamental<long double> {
enum { _C_val = 1 }; };
207#ifndef _RWSTD_NO_BOOL
210struct __rw_is_fundamental<
bool> {
enum { _C_val = 1 }; };
214#ifndef _RWSTD_NO_NATIVE_WCHAR_T
217struct __rw_is_fundamental<
wchar_t> {
enum { _C_val = 1 }; };
222struct __rw_is_fundamental<void> {
enum { _C_val = 1 }; };
225template <
class _TypeT>
229 struct _C_yes {
int _C_dummy [2]; };
235 _C_indirect (
double);
241 static _C_no _C_is (
int, ...);
242 static _C_yes _C_is (
int, _C_indirect);
244 static _TypeT _C_make_T ();
247#if !defined (__HP_aCC) || __HP_aCC > 33000
250 _C_val =
sizeof (_C_yes)
251 ==
sizeof (_C_nest::_C_is (0, _C_nest::_C_make_T ()))
252 && !__rw_is_fundamental<_TypeT>::_C_val
258 typedef typename __rw_is_reference<_TypeT>::_C_type _C_type;
263 _C_val =
sizeof (_C_yes) ==
sizeof (_C_nest::_C_is (0, _C_type ()))
264 && !__rw_is_fundamental<_TypeT>::_C_val;
271#if defined (__HP_aCC) && __HP_aCC <= 33000
273template <
class _TypeT>
274const bool __rw_is_enum<_TypeT>::_C_val;
280struct __rw_is_enum<void>
286template <
class _TypeT>
287struct __rw_type_traits
289 typedef typename __rw_is_const<_TypeT>::_C_type _C_non_const_type;
290 typedef typename __rw_is_volatile<_TypeT>::_C_type _C_non_volatile_type;
291 typedef typename __rw_is_pointer<_TypeT>::_C_type _C_non_pointer_type;
292 typedef typename __rw_is_reference<_TypeT>::_C_type _C_non_reference_type;
294 typedef typename __rw_is_cv_qualified<_TypeT>::_C_type
295 _C_non_cv_qualified_type;
298 _C_is_const = __rw_is_const<_TypeT>::_C_val,
299 _C_is_volatile = __rw_is_volatile<_TypeT>::_C_val,
300 _C_is_cv_qualified = __rw_is_cv_qualified<_TypeT>::_C_val,
301 _C_is_pointer = __rw_is_pointer<_TypeT>::_C_val,
302 _C_is_reference = __rw_is_reference<_TypeT>::_C_val,
303 _C_is_fundamental = __rw_is_fundamental<_TypeT>::_C_val,
304 _C_is_enum = __rw_is_enum<_TypeT>::_C_val,
305 _C_is_class = !_C_is_pointer
307 && !_C_is_fundamental
#define _RWSTD_SPECIALIZED_CLASS
#define _RWSTD_NAMESPACE(name)