30#ifndef _RWSTD_RW_META_CAT_H_INCLUDED
31#define _RWSTD_RW_META_CAT_H_INCLUDED
38#define _RWSTD_TRAIT_SPEC_0_CV(Trait,Type,Cond) \
39 template <> struct Trait<Type> \
40 : __rw_integral_constant<bool, Cond> { }; \
41 template <> struct Trait<Type const> \
42 : __rw_integral_constant<bool, Cond> { }; \
43 template <> struct Trait<Type volatile> \
44 : __rw_integral_constant<bool, Cond> { }; \
45 template <> struct Trait<Type const volatile> \
46 : __rw_integral_constant<bool, Cond> { }
48#define _RWSTD_TRAIT_SPEC_1_CV(Trait,Type,Cond) \
49 template <class _TypeT> struct Trait<Type> \
50 : __rw_integral_constant<bool, Cond> { }; \
51 template <class _TypeT> struct Trait<Type const> \
52 : __rw_integral_constant<bool, Cond> { }; \
53 template <class _TypeT> struct Trait<Type volatile> \
54 : __rw_integral_constant<bool, Cond> { }; \
55 template <class _TypeT> struct Trait<Type const volatile> \
56 : __rw_integral_constant<bool, Cond> { }
58#define _RWSTD_TRAIT_SPEC_2_CV(Trait,Type,Cond) \
59 template <class _TypeT, class _ClassT> struct Trait<Type> \
60 : __rw_integral_constant<bool, Cond> { }; \
61 template <class _TypeT, class _ClassT> struct Trait<Type const> \
62 : __rw_integral_constant<bool, Cond> { }; \
63 template <class _TypeT, class _ClassT> struct Trait<Type volatile> \
64 : __rw_integral_constant<bool, Cond> { }; \
65 template <class _TypeT, class _ClassT> \
66 struct Trait<Type const volatile> \
67 : __rw_integral_constant<bool, Cond> { }
69template <
class _TypeT>
70struct __rw_is_void : __rw_false_type
76#define _RWSTD_IS_VOID(T) _RW::__rw_is_void<T>::value
79template <
class _TypeT>
80struct __rw_is_integral : __rw_false_type
92#ifndef _RWSTD_NO_NATIVE_WCHAR_T
105#ifndef _RWSTD_NO_LONG_LONG
110#define _RWSTD_IS_INTEGRAL(T) _RW::__rw_is_integral<T>::value
112template <
class _TypeT>
113struct __rw_is_floating_point : __rw_false_type
120#ifndef _RWSTD_NO_LONG_DOUBLE
124#define _RWSTD_IS_FLOATING_POINT(T) _RW::__rw_is_floating_point<T>::value
127template <
class _TypeT>
128struct __rw_is_array : __rw_false_type
132template <
class _TypeT, _RWSTD_SIZE_T _Size>
133struct __rw_is_array<_TypeT [_Size]> : __rw_true_type
137#if !defined (__IBMCPP__) || (900 < __IBMCPP__)
139template <
class _TypeT>
140struct __rw_is_array<_TypeT []> : __rw_true_type
146#define _RWSTD_IS_ARRAY(T) _RW::__rw_is_array<T>::value
148template <
class _TypeT>
149struct __rw_is_pointer : __rw_false_type
155#define _RWSTD_IS_POINTER(T) _RW::__rw_is_pointer<T>::value
158template <
class _TypeT>
159struct __rw_is_lvalue_reference : __rw_false_type
163template <
class _TypeT>
164struct __rw_is_lvalue_reference<_TypeT&> : __rw_true_type
168#define _RWSTD_IS_LVALUE_REFERENCE(T) \
169 _RW::__rw_is_lvalue_reference<T>::value
172template <
class _TypeT>
173struct __rw_is_rvalue_reference : __rw_false_type
178#ifndef _RWSTD_NO_RVALUE_REFERENCES
180template <
class _TypeT>
181struct __rw_is_rvalue_reference<_TypeT&&> : __rw_true_type
187#define _RWSTD_IS_RVALUE_REFERENCE(T) \
188 _RW::__rw_is_rvalue_reference<T>::value
192template <
class _TypeT>
193struct __rw_is_class_or_union
196 struct _C_yes { _C_no __pad[2]; };
198 template <
class _TypeU>
199 static _C_yes _C_is (
int,
long _TypeU::*);
201 template <
class _TypeU>
202 static _C_no _C_is (
int, ...);
205 sizeof (_C_yes) ==
sizeof (_C_is<_TypeT>(0, 0))
209#if defined (_RWSTD_TT_IS_UNION)
210# define _RWSTD_IS_UNION(T) _RWSTD_TT_IS_UNION(T)
211#elif defined (_RWSTD_TT_IS_CLASS)
212# define _RWSTD_IS_UNION(T) \
213 _RW::__rw_is_class_or_union<T>::value && !_RWSTD_TT_IS_CLASS(T)
215# define _RWSTD_IS_UNION(T) 0
218template <
class _TypeT>
220 : __rw_integral_constant<bool, _RWSTD_IS_UNION(_TypeT)>
225#if defined (_RWSTD_TT_IS_CLASS)
226# define _RWSTD_IS_CLASS(T) _RWSTD_TT_IS_CLASS(T)
227#elif defined (_RWSTD_TT_IS_UNION)
228# define _RWSTD_IS_CLASS(T) \
229 _RW::__rw_is_class_or_union<T>::value && !_RWSTD_TT_IS_UNION(T)
231# define _RWSTD_IS_CLASS(T) _RW::__rw_is_class_or_union<T>::value
234template <
class _TypeT>
236 : __rw_integral_constant<bool, _RWSTD_IS_CLASS(_TypeT)>
242#ifdef _RWSTD_TT_IS_ENUM
243# define _RWSTD_IS_ENUM(T) _RWSTD_TT_IS_ENUM(T)
246template <class _TypeT, bool = __rw_is_void<_TypeT>::value
247 || __rw_is_array<_TypeT>::value
248 || __rw_is_integral<_TypeT>::value
249 || __rw_is_floating_point<_TypeT>::value
250 || __rw_is_lvalue_reference<_TypeT>::value
251 || __rw_is_rvalue_reference<_TypeT>::value
252 || __rw_is_class_or_union<_TypeT>::value>
253struct __rw_is_enum_impl
255 enum { _C_value = 0 };
258template <
class _TypeT>
259struct __rw_is_enum_impl<_TypeT,
false>
262 struct _C_yes { _C_no __pad [2]; };
265 static _C_no _C_is (
int, ...);
266 static _C_yes _C_is (
int,
double);
268 static _TypeT& _C_make ();
271 _C_value =
sizeof (_C_yes) ==
sizeof (_C_is (0, _C_make ()))
275# define _RWSTD_IS_ENUM(T) _RW::__rw_is_enum_impl<T>::_C_value
278template <
class _TypeT>
280 : __rw_integral_constant<bool, _RWSTD_IS_ENUM(_TypeT)>
286#ifdef _RWSTD_TT_IS_FUNCTION
287# define _RWSTD_IS_FUNCTION(T) _RWSTD_TT_IS_FUNCTION(T)
297template <class _TypeT, bool = __rw_is_void<_TypeT>::value
298 || __rw_is_array<_TypeT>::value
299 || __rw_is_pointer<_TypeT>::value
300 || __rw_is_lvalue_reference<_TypeT>::value
301 || __rw_is_rvalue_reference<_TypeT>::value
302 || __rw_is_class_or_union<_TypeT>::value>
303struct __rw_is_function_impl
305 enum { _C_value = 0 };
314template <
class _TypeT>
315struct __rw_is_function_impl<_TypeT,
false>
317 typedef _TypeT& _TypeT_Ref;
318 typedef _TypeT* _TypeT_Ptr;
321 struct _C_yes { _C_no __pad [2]; };
323 static _C_yes _C_is (_TypeT_Ptr);
325 template <
class _TypeU>
326 static _C_no _C_is (_TypeU);
328 static _TypeT_Ref _C_make ();
330 enum { _C_value =
sizeof (_C_yes) ==
sizeof (_C_is (_C_make ())) };
333# define _RWSTD_IS_FUNCTION(T) _RW::__rw_is_function_impl<T>::_C_value
336template <
class _TypeT>
337struct __rw_is_function
338 : __rw_integral_constant<bool, _RWSTD_IS_FUNCTION(_TypeT)>
343template <
class _TypeT>
344struct __rw_is_member_object_pointer : __rw_false_type
350 !__rw_is_function<_TypeT>::value);
352#define _RWSTD_IS_MEMBER_OBJECT_PTR(T) \
353 _RW::__rw_is_member_object_pointer<T>::value
356template <
class _TypeT>
357struct __rw_is_member_function_pointer : __rw_false_type
363 __rw_is_function<_TypeT>::value);
365#define _RWSTD_IS_MEMBER_FUNCTION_PTR(T) \
366 _RW::__rw_is_member_function_pointer<T>::value
368#undef _RWSTD_TRAIT_SPEC_2_CV
369#undef _RWSTD_TRAIT_SPEC_1_CV
370#undef _RWSTD_TRAIT_SPEC_0_CV
#define _RWSTD_NAMESPACE(name)