Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
_meta_prop.h
Go to the documentation of this file.
1
30#ifndef _RWSTD_RW_META_PROP_H_INCLUDED
31#define _RWSTD_RW_META_PROP_H_INCLUDED
32
33#include <rw/_defs.h>
34#include <rw/_meta_cat.h>
35#include <rw/_meta_comp.h>
36#include <rw/_meta_arr.h>
37#include <rw/_meta_cv.h>
38
40
41#define _RWSTD_TRAIT_SPEC_0_CV(Trait,Type) \
42 template <> struct Trait<Type> : __rw_true_type { }; \
43 template <> struct Trait<Type const > : __rw_true_type { }; \
44 template <> struct Trait<Type volatile> : __rw_true_type { }; \
45 template <> struct Trait<Type const volatile> : __rw_true_type { }
46
47template <class _TypeT>
48struct __rw_is_const : __rw_false_type
49{
50};
51
52template <class _TypeT>
53struct __rw_is_const<const _TypeT> : __rw_true_type
54{
55};
56
57template <class _TypeT>
58struct __rw_is_volatile : __rw_false_type
59{
60};
61
62template <class _TypeT>
63struct __rw_is_volatile<volatile _TypeT> : __rw_true_type
64{
65};
66
67#if defined (__SUNPRO_CC) && (__SUNPRO_CC <= 0x590) \
68 || defined (_MSC_VER) && (_MSC_VER <= 1400)
69
70// additional specializations needed for these compilers
71
72template <class _TypeT>
73struct __rw_is_const<const _TypeT []> : __rw_true_type
74{
75};
76
77template <class _TypeT, _RWSTD_SIZE_T _Size>
78struct __rw_is_const<const _TypeT [_Size]> : __rw_true_type
79{
80};
81
82template <class _TypeT>
83struct __rw_is_volatile<volatile _TypeT []> : __rw_true_type
84{
85};
86
87template <class _TypeT, _RWSTD_SIZE_T _Size>
88struct __rw_is_volatile<volatile _TypeT [_Size]> : __rw_true_type
89{
90};
91
92#endif
93
94#define _RWSTD_IS_CONST(T) _RW::__rw_is_const<T>::value
95#define _RWSTD_IS_VOLATILE(T) _RW::__rw_is_volatile<T>::value
96
97
98#if !defined(_RWSTD_TT_IS_POD)
99
100template <class _TypeT>
101struct __rw_is_pod_impl
102{
103 typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
104 typedef typename __rw_remove_cv<_TypeU>::type _NoCV_TypeU;
105
106 enum { _C_value = __rw_is_scalar<_NoCV_TypeU>::value };
107};
108
109# define _RWSTD_IS_POD(T) _RW::__rw_is_pod_impl<T>::_C_value
110
111#elif defined (__EDG_VERSION__) || defined (_MSC_VER)
112
113template <class _TypeT>
114struct __rw_is_pod_impl
115{
116 typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
117 typedef typename __rw_remove_cv<_TypeU>::type _NoCV_TypeU;
118
119 // __is_pod works for pod class types only, add scalars
120 enum { _C_value = __rw_is_scalar<_NoCV_TypeU>::value
121 || _RWSTD_TT_IS_POD(_NoCV_TypeU) };
122};
123
124# define _RWSTD_IS_POD(T) _RW::__rw_is_pod_impl<T>::_C_value
125
126#else
127# define _RWSTD_IS_POD(T) _RWSTD_TT_IS_POD(T)
128#endif // _RWSTD_TT_IS_POD
129
130template <class _TypeT>
131struct __rw_is_pod
132 : __rw_integral_constant<bool, _RWSTD_IS_POD(_TypeT)>
133{
134};
135
136
137#if !defined (_RWSTD_TT_IS_STANDARD_LAYOUT)
138# define _RWSTD_IS_STANDARD_LAYOUT(T) _RWSTD_IS_POD(T)
139#else
140# define _RWSTD_IS_STANDARD_LAYOUT(T) _RWSTD_TT_IS_STANDARD_LAYOUT(T)
141#endif // _RWSTD_TT_IS_STANDARD_LAYOUT
142
143template <class _TypeT>
144struct __rw_is_standard_layout
145 : __rw_integral_constant<bool, _RWSTD_IS_STANDARD_LAYOUT(_TypeT)>
146{
147};
148
149
150
151#if defined (_RWSTD_TT_IS_EMPTY)
152
153# if defined (__EDG_VERSION__) || defined (_MSC_VER)
154# define _RWSTD_IS_EMPTY(T) \
155 (_RWSTD_TT_IS_EMPTY(T) && !_RW::__rw_is_union<T>::value)
156# else
157# define _RWSTD_IS_EMPTY(T) _RWSTD_TT_IS_EMPTY(T)
158# endif
159
160#elif defined (_RWSTD_TT_IS_CLASS) || defined (_RWSTD_TT_IS_UNION)
161
162//
163// The primary template is for the case that _TypeT is a class type.
164// It checks that the size of a derived class is larger than the size
165// of a non-derived class. If the sizes are the same, then _TypeT is
166// assumed to be an empty class.
167//
168template <class _TypeT, bool = __rw_is_class<_TypeT>::value>
169struct __rw_is_empty_impl
170{
171 struct _C_empty_1 : _TypeT { long _C_pad [32]; };
172 struct _C_empty_2 { long _C_pad [32]; };
173
174 enum { _C_value = sizeof (_C_empty_1) == sizeof (_C_empty_2) };
175};
176
177//
178// This specialization is for the case that _TypeT is a union or other
179// non-class type.
180//
181template <class _TypeT>
182struct __rw_is_empty_impl<_TypeT, false>
183{
184 enum { _C_value = 0 };
185};
186
187# define _RWSTD_IS_EMPTY(T) _RW::__rw_is_empty_impl<T>::_C_value
188
189#else
190 // we have no reliable way to tell if the type is empty,
191 // so we assume that it is not.
192# define _RWSTD_IS_EMPTY(T) 0
193#endif // !_RWSTD_TT_IS_EMPTY
194
195template <class _TypeT>
196struct __rw_is_empty
197 : __rw_integral_constant<bool, _RWSTD_IS_EMPTY(_TypeT)>
198{
199};
200
201
202#if defined (_RWSTD_TT_IS_POLYMORPHIC)
203# define _RWSTD_IS_POLYMORPHIC(T) _RWSTD_TT_IS_POLYMORPHIC(T)
204#elif defined (_RWSTD_TT_IS_CLASS) || defined (_RWSTD_TT_IS_UNION)
205
206//
207// The primary template is for the case that _TypeT is class type.
208// It checks the size of a derived class against the size of a
209// derived class that provides a virtual method. If the size of
210// the objects are the same then we assume that _TypeT already
211// has a vtbl pointer.
212//
213template <class _TypeT, bool = __rw_is_class<_TypeT>::value>
214struct __rw_is_polymorphic_impl
215{
216 template <class _TypeU>
217 struct _C_type_1 : _TypeU
218 {
219 // only polymorphic if _TypeT is
220 };
221
222 template <class _TypeU>
223 struct _C_type_2 : _TypeU
224 {
225 virtual void _C_method ();
226 };
227
228 enum { _C_value = sizeof (_C_type_1<_TypeT>)
229 == sizeof (_C_type_2<_TypeT>) };
230};
231
232//
233// This specialization is for the case that _TypeT is not a class type.
234//
235template <class _TypeT>
236struct __rw_is_polymorphic_impl<_TypeT, false>
237{
238 enum { _C_value = 0 };
239};
240
241# define _RWSTD_IS_POLYMORPHIC(T) \
242 _RW::__rw_is_polymorphic_impl<T>::_C_value
243
244#else
245# define _RWSTD_IS_POLYMORPHIC(T) _RW::__rw_is_class_or_union<T>::value
246#endif // _RWSTD_TT_IS_POLYMORPHIC
247
248template <class _TypeT>
249struct __rw_is_polymorphic
250 : __rw_integral_constant<bool, _RWSTD_IS_POLYMORPHIC(_TypeT)>
251{
252};
253
254
255
256#if defined (_RWSTD_TT_IS_ABSTRACT)
257# define _RWSTD_IS_ABSTRACT(T) _RWSTD_TT_IS_ABSTRACT(T)
258#elif defined (_RWSTD_TT_IS_CLASS) || defined (_RWSTD_TT_IS_UNION)
259
260//
261// The primary template is for the case that _TypeT is class type.
262// It checks that _TypeT is an abstract type by exploiting the
263// resolution to CWG#337 [http://tinyurl.com/6yltlk]
264//
265template <class _TypeT, bool = __rw_is_class<_TypeT>::value>
266struct __rw_is_abstract_impl
267{
268 struct _C_no { };
269 struct _C_yes { _C_no __pad[2]; };
270
271 template <class U>
272 static _C_yes _C_is (int, ...);
273
274 template <class U>
275 static _C_no _C_is (int, U(*)[1]);
276
277 enum { _C_value = sizeof (_C_yes)
278 == sizeof (_C_is<_TypeT>(0, 0)) };
279};
280
281//
282// This specialization is for the case that _TypeT is not a class type.
283//
284template <class T>
285struct __rw_is_abstract_impl<T,true>
286{
287 enum { _C_value = 0 };
288};
289
290# define _RWSTD_IS_ABSTRACT(T) _RW::__rw_is_abstract_impl<T>::_C_value
291
292#else
293# define _RWSTD_IS_ABSTRACT(T) _RW::__rw_is_class_or_union<T>::value
294#endif // !_RWSTD_TT_IS_ABSTRACT
295
296template <class _TypeT>
297struct __rw_is_abstract
298 : __rw_integral_constant<bool, _RWSTD_IS_ABSTRACT(_TypeT)>
299{
300};
301
302
303
304#if !defined (_RWSTD_TT_HAS_TRIVIAL_CTOR)
305# define _RWSTD_HAS_TRIVIAL_CTOR(T) _RW::__rw_is_pod<T>::value
306#elif defined (__EDG_VERSION__) || defined (_MSC_VER)
307
308template <class _TypeT>
309struct __rw_has_trivial_ctor_impl
310{
311 typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
312
313 enum { _C_value = __rw_is_scalar<_TypeU>::value
314 || _RWSTD_TT_HAS_TRIVIAL_CTOR (_TypeU) };
315};
316
317# define _RWSTD_HAS_TRIVIAL_CTOR(T) \
318 _RW::__rw_has_trivial_ctor_impl<T>::_C_value
319
320#else
321# define _RWSTD_HAS_TRIVIAL_CTOR(T) _RWSTD_TT_HAS_TRIVIAL_CTOR(T)
322#endif // _RWSTD_TT_HAS_TRIVIAL_CTOR
323
324template <class _TypeT>
325struct __rw_has_trivial_ctor
326 : __rw_integral_constant<bool, _RWSTD_HAS_TRIVIAL_CTOR(_TypeT)>
327{
328};
329
330
331
332#if !defined (_RWSTD_TT_HAS_TRIVIAL_COPY)
333# define _RWSTD_HAS_TRIVIAL_COPY(T) \
334 ( !_RW::__rw_is_array<T>::value \
335 && ( _RW::__rw_is_reference<T>::value \
336 || _RW::__rw_is_pod<T>::value))
337#elif defined (__EDG_VERSION__) || defined (_MSC_VER)
338# define _RWSTD_HAS_TRIVIAL_COPY(T) \
339 ( _RW::__rw_is_reference<T>::value \
340 || _RW::__rw_is_scalar<T>::value \
341 || _RWSTD_TT_HAS_TRIVIAL_COPY(T))
342#elif defined (__GNUG__)
343# define _RWSTD_HAS_TRIVIAL_COPY(T) \
344 (!_RW::__rw_is_array<T>::value && _RWSTD_TT_HAS_TRIVIAL_COPY(T))
345#else
346# define _RWSTD_HAS_TRIVIAL_COPY(T) _RWSTD_TT_HAS_TRIVIAL_COPY(T)
347#endif // !_RWSTD_TT_HAS_TRIVIAL_COPY
348
349template <class _TypeT>
350struct __rw_has_trivial_copy
351 : __rw_integral_constant<bool, _RWSTD_HAS_TRIVIAL_COPY(_TypeT)>
352{
353};
354
355
356#if !defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN)
357# define _RWSTD_HAS_TRIVIAL_ASSIGN(T) \
358 ( _RW::__rw_is_pod<T>::value \
359 && !_RW::__rw_is_const<T>::value \
360 && !_RW::__rw_is_reference<T>::value \
361 && !_RW::__rw_is_array<T>::value)
362#elif defined (__EDG_VERSION__)
363# define _RWSTD_HAS_TRIVIAL_ASSIGN(T) \
364 (!_RW::__rw_is_array<T>::value \
365 && !_RW::__rw_is_const<T>::value \
366 && !_RW::__rw_is_reference<T>::value \
367 && (_RW::__rw_is_scalar<T>::value || _RWSTD_TT_HAS_TRIVIAL_ASSIGN(T)))
368#elif defined (__GNUG__)
369# define _RWSTD_HAS_TRIVIAL_ASSIGN(T) \
370 (!_RW::__rw_is_array<T>::value && _RWSTD_TT_HAS_TRIVIAL_ASSIGN(T))
371#elif defined (_MSC_VER)
372# define _RWSTD_HAS_TRIVIAL_ASSIGN(T) \
373 (!_RW::__rw_is_const<T>::value \
374 && (_RW::__rw_is_scalar<T>::value || _RWSTD_TT_HAS_TRIVIAL_ASSIGN(T)))
375#else
376# define _RWSTD_HAS_TRIVIAL_ASSIGN(T) _RWSTD_TT_HAS_TRIVIAL_ASSIGN(T)
377#endif // _RWSTD_TT_HAS_TRIVIAL_ASSIGN
378
379template <class _TypeT>
380struct __rw_has_trivial_assign
381 : __rw_integral_constant<bool, _RWSTD_HAS_TRIVIAL_ASSIGN(_TypeT)>
382{
383};
384
385
386
387#if !defined (_RWSTD_TT_HAS_TRIVIAL_DTOR)
388# define _RWSTD_HAS_TRIVIAL_DTOR(T) \
389 (_RW::__rw_is_pod<T>::value || _RW::__rw_is_reference<T>::value)
390#elif defined (__GNUC__)
391# define _RWSTD_HAS_TRIVIAL_DTOR(T) \
392 ( _RW::__rw_is_reference<_TypeT>::value \
393 || _RWSTD_TT_HAS_TRIVIAL_DTOR (_TypeT))
394#elif defined (__EDG_VERSION__) || defined (_MSC_VER)
395
396template <class _TypeT>
397struct __rw_has_trivial_dtor_impl
398{
399 typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
400
401 enum { _C_value = __rw_is_scalar<_TypeU>::value
402 || __rw_is_reference<_TypeU>::value
403 || _RWSTD_TT_HAS_TRIVIAL_DTOR (_TypeU) };
404};
405
406# define _RWSTD_HAS_TRIVIAL_DTOR(T) \
407 _RW::__rw_has_trivial_dtor_impl<T>::_C_value
408
409#else
410# define _RWSTD_HAS_TRIVIAL_DTOR(T) _RWSTD_TT_HAS_TRIVIAL_DTOR(T)
411#endif // !_RWSTD_TT_HAS_TRIVIAL_DTOR
412
413template <class _TypeT>
414struct __rw_has_trivial_dtor
415 : __rw_integral_constant<bool, _RWSTD_HAS_TRIVIAL_DTOR(_TypeT)>
416{
417};
418
419
420
421template <class _TypeT>
422struct __rw_is_trivial_impl
423{
424 typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
425 typedef typename __rw_remove_cv<_TypeU>::type _NoCV_TypeU;
426
427 enum { _C_value = __rw_is_scalar<_NoCV_TypeU>::value
428 || __rw_has_trivial_ctor<_NoCV_TypeU>::value
429 && __rw_has_trivial_copy<_NoCV_TypeU>::value
430 && __rw_has_trivial_dtor<_NoCV_TypeU>::value
431 && __rw_has_trivial_assign<_NoCV_TypeU>::value
432 && ( __rw_is_class<_NoCV_TypeU>::value
433 || __rw_is_union<_NoCV_TypeU>::value) };
434};
435
436template <class _TypeT>
437struct __rw_is_trivial
438 : __rw_integral_constant<bool, __rw_is_trivial_impl<_TypeT>::_C_value>
439{
440};
441
442#define _RWSTD_IS_TRIVIAL(T) _RW::__rw_is_trivial<T>::value
443
444
445
446#if !defined (_RWSTD_TT_HAS_NOTHROW_CTOR)
447# define _RWSTD_HAS_NOTHROW_CTOR(T) _RW::__rw_has_trivial_ctor<T>::value
448#elif defined (__EDG_VERSION__) || defined (_MSC_VER)
449
450template <class _TypeT>
451struct __rw_has_nothrow_ctor_impl
452{
453 typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
454
455 enum { _C_value = __rw_has_trivial_ctor<_TypeT>::value
456 || _RWSTD_TT_HAS_NOTHROW_CTOR (_TypeU) };
457};
458
459# define _RWSTD_HAS_NOTHROW_CTOR(T) \
460 _RW::__rw_has_nothrow_ctor_impl<T>::_C_value
461
462#else
463# define _RWSTD_HAS_NOTHROW_CTOR(T) _RWSTD_TT_HAS_NOTHROW_CTOR(T)
464#endif // _RWSTD_TT_HAS_NOTHROW_CTOR
465
466template <class _TypeT>
467struct __rw_has_nothrow_ctor
468 : __rw_integral_constant<bool, _RWSTD_HAS_NOTHROW_CTOR(_TypeT)>
469{
470};
471
472
473#if !defined (_RWSTD_TT_HAS_NOTHROW_COPY)
474# define _RWSTD_HAS_NOTHROW_COPY(T) _RW::__rw_has_trivial_copy<T>::value
475#elif defined (__EDG_VERSION__) || defined (_MSC_VER)
476# define _RWSTD_HAS_NOTHROW_COPY(T) \
477 (_RW::__rw_has_trivial_copy<T>::value || _RWSTD_TT_HAS_NOTHROW_COPY(T))
478#elif defined (__GNUG__)
479# define _RWSTD_HAS_NOTHROW_COPY(T) \
480 (!_RW::__rw_is_array<T>::value && _RWSTD_TT_HAS_NOTHROW_COPY(T))
481#else
482# define _RWSTD_HAS_NOTHROW_COPY(T) _RWSTD_TT_HAS_NOTHROW_COPY(T)
483#endif // !_RWSTD_TT_HAS_NOTHROW_COPY
484
485template <class _TypeT>
486struct __rw_has_nothrow_copy
487 : __rw_integral_constant<bool, _RWSTD_HAS_NOTHROW_COPY(_TypeT)>
488{
489};
490
491
492
493#if !defined (_RWSTD_TT_HAS_NOTHROW_ASSIGN)
494# define _RWSTD_HAS_NOTHROW_ASSIGN(T) \
495 _RW::__rw_has_trivial_assign<T>::value
496#elif defined (__EDG_VERSION__)
497# define _RWSTD_HAS_NOTHROW_ASSIGN(T) \
498 (!_RW::__rw_is_const<T>::value \
499 && !_RW::__rw_is_reference<T>::value \
500 && ( _RW::__rw_has_trivial_assign<T>::value \
501 || _RWSTD_TT_HAS_NOTHROW_ASSIGN(T)))
502#elif defined (__GNUG__)
503# define _RWSTD_HAS_NOTHROW_ASSIGN(T) \
504 ( !_RW::__rw_is_array<T>::value \
505 && _RWSTD_TT_HAS_NOTHROW_ASSIGN(T))
506#elif defined (_MSC_VER)
507# define _RWSTD_HAS_NOTHROW_ASSIGN(T) \
508 (!_RW::__rw_is_const<T>::value \
509 && ( _RW::__rw_has_trivial_assign<T>::value \
510 || _RWSTD_TT_HAS_NOTHROW_ASSIGN(T)))
511#else
512# define _RWSTD_HAS_NOTHROW_ASSIGN(T) _RWSTD_TT_HAS_NOTHROW_ASSIGN(T)
513#endif // !_RWSTD_TT_HAS_NOTHROW_ASSIGN
514
515template <class _TypeT>
516struct __rw_has_nothrow_assign
517 : __rw_integral_constant<bool, _RWSTD_HAS_NOTHROW_ASSIGN(_TypeT)>
518{
519};
520
521
522#if !defined (_RWSTD_TT_HAS_VIRTUAL_DTOR)
523# define _RWSTD_HAS_VIRTUAL_DTOR(T) _RW::__rw_is_polymorphic<T>::value
524#else
525# define _RWSTD_HAS_VIRTUAL_DTOR(T) _RWSTD_TT_HAS_VIRTUAL_DTOR(T)
526#endif // _RWSTD_TT_HAS_VIRTUAL_DTOR
527
528template <class _TypeT>
529struct __rw_has_virtual_dtor
530 : __rw_integral_constant<bool, _RWSTD_HAS_VIRTUAL_DTOR(_TypeT)>
531{
532};
533
534
535template <class _TypeT>
536struct __rw_is_unsigned : __rw_false_type
537{
538};
539
540template <class _TypeT>
541struct __rw_is_signed : __rw_false_type
542{
543};
544
545#if (_RWSTD_CHAR_MIN < 0)
546_RWSTD_TRAIT_SPEC_0_CV(__rw_is_signed, char);
547#else
548_RWSTD_TRAIT_SPEC_0_CV(__rw_is_unsigned, char);
549#endif
550
551#ifndef _RWSTD_NO_NATIVE_WCHAR_T
552# if (_RWSTD_WCHAR_MIN < 0)
553_RWSTD_TRAIT_SPEC_0_CV(__rw_is_signed, wchar_t);
554# else
555_RWSTD_TRAIT_SPEC_0_CV(__rw_is_unsigned, wchar_t);
556# endif
557#endif // _RWSTD_NO_NATIVE_WCHAR_T
558
559_RWSTD_TRAIT_SPEC_0_CV(__rw_is_signed, signed char);
560_RWSTD_TRAIT_SPEC_0_CV(__rw_is_unsigned, unsigned char);
561
562_RWSTD_TRAIT_SPEC_0_CV(__rw_is_signed, signed short);
563_RWSTD_TRAIT_SPEC_0_CV(__rw_is_unsigned, unsigned short);
564
565_RWSTD_TRAIT_SPEC_0_CV(__rw_is_signed, signed int);
566_RWSTD_TRAIT_SPEC_0_CV(__rw_is_unsigned, unsigned int);
567
568_RWSTD_TRAIT_SPEC_0_CV(__rw_is_signed, signed long);
569_RWSTD_TRAIT_SPEC_0_CV(__rw_is_unsigned, unsigned long);
570
571#ifndef _RWSTD_NO_LONG_LONG
572_RWSTD_TRAIT_SPEC_0_CV(__rw_is_signed, signed long long);
573_RWSTD_TRAIT_SPEC_0_CV(__rw_is_unsigned, unsigned long long);
574#endif // _RWSTD_NO_LONG_LONG
575
576#if 0
577_RWSTD_TRAIT_SPEC_0_CV(__rw_is_unsigned, char16_t);
578_RWSTD_TRAIT_SPEC_0_CV(__rw_is_unsigned, char32_t);
579#endif
580
581_RWSTD_TRAIT_SPEC_0_CV(__rw_is_signed, float);
582_RWSTD_TRAIT_SPEC_0_CV(__rw_is_signed, double);
583
584#ifndef _RWSTD_NO_LONG_DOUBLE
585_RWSTD_TRAIT_SPEC_0_CV(__rw_is_signed, long double);
586#endif // _RWSTD_NO_LONG_DOUBLE
587
588#define _RWSTD_IS_SIGNED(T) _RW::__rw_is_signed<T>::value
589#define _RWSTD_IS_UNSIGNED(T) _RW::__rw_is_unsigned<T>::value
590
591
592
593#ifndef _RWSTD_NO_ALIGN_TRAITS
594
595# if defined (_RWSTD_TT_ALIGN_OF)
596# define _RWSTD_ALIGN_OF(T) _RWSTD_TT_ALIGN_OF(T)
597# else
598
599template <class _TypeT>
600struct __rw_alignment_of_impl
601{
602 template <class _TypeU>
603 struct _C_nest
604 {
605 unsigned char _C_char;
606 _TypeU _C_type;
607 };
608
609 enum { _C_value =
610 sizeof (_C_nest<_TypeT>) - sizeof (_TypeT) < sizeof (_TypeT)
611 ? sizeof (_C_nest<_TypeT>) - sizeof (_TypeT) < sizeof (_TypeT)
612 : sizeof (_TypeT) };
613};
614
615template <>
616struct __rw_alignment_of_impl<void>
617{
618 enum { _C_value = 0 };
619};
620
621template <>
622struct __rw_alignment_of_impl<const void>
623{
624 enum { _C_value = 0 };
625};
626
627template <>
628struct __rw_alignment_of_impl<volatile void>
629{
630 enum { _C_value = 0 };
631};
632
633template <>
634struct __rw_alignment_of_impl<const volatile void>
635{
636 enum { _C_value = 0 };
637};
638
639# define _RWSTD_ALIGN_OF(T) _RW::__rw_alignment_of_impl<T>::_C_value
640# endif // !_RWSTD_TT_ALIGN_OF
641
642template <class _TypeT>
643struct __rw_alignment_of
644 : __rw_integral_constant<_RWSTD_SIZE_T, _RWSTD_ALIGN_OF(_TypeT)>
645{
646};
647
648#endif // !_RWSTD_NO_ALIGN_TRAITS
649
650template <class _TypeT>
651struct __rw_rank
652 : __rw_integral_constant<_RWSTD_SIZE_T, 0>
653{
654};
655
656template <class _TypeT, _RWSTD_SIZE_T _Size>
657struct __rw_rank<_TypeT [_Size]>
658 : __rw_integral_constant<_RWSTD_SIZE_T, 1 + __rw_rank<_TypeT>::value>
659{
660};
661
662#if !defined (__IBMCPP__) || (900 < __IBMCPP__)
663
664template <class _TypeT>
665struct __rw_rank<_TypeT []>
666 : __rw_integral_constant<_RWSTD_SIZE_T, 1 + __rw_rank<_TypeT>::value>
667{
668};
669
670#endif
671
672#define _RWSTD_RANK(T) _RW::__rw_rank<T>::value
673
674
675
676template <class _TypeT, _RWSTD_SIZE_T _Depth>
677struct __rw_extent
678 : __rw_integral_constant<_RWSTD_SIZE_T, 0>
679{
680};
681
682template <class _TypeT, _RWSTD_SIZE_T _Size, _RWSTD_SIZE_T _Depth>
683struct __rw_extent<_TypeT [_Size], _Depth>
684 : __rw_integral_constant<_RWSTD_SIZE_T,
685 __rw_extent<_TypeT, _Depth - 1>::value>
686{
687};
688
689#if !defined (__IBMCPP__) || (900 < __IBMCPP__)
690
691template <class _TypeT, _RWSTD_SIZE_T _Depth>
692struct __rw_extent<_TypeT [], _Depth>
693 : __rw_integral_constant<_RWSTD_SIZE_T,
694 __rw_extent<_TypeT, _Depth - 1>::value>
695{
696};
697
698#endif
699
700template <class _TypeT, _RWSTD_SIZE_T _Size>
701struct __rw_extent<_TypeT [_Size], 0>
702 : __rw_integral_constant<_RWSTD_SIZE_T, _Size>
703{
704};
705
706#if !defined (__IBMCPP__) || (900 < __IBMCPP__)
707
708template <class _TypeT>
709struct __rw_extent<_TypeT [], 0>
710 : __rw_integral_constant<_RWSTD_SIZE_T, 0>
711{
712};
713
714#endif
715
716#define _RWSTD_EXTENT(T,D) _RW::__rw_extent<T,D>::value
717
718} // namespace __rw
719
720
721#endif // _RWSTD_RW_META_PROP_H_INCLUDED
722
#define T
Definition 17.names.cpp:163
#define U
Definition 17.names.cpp:164
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567
#define _RWSTD_TRAIT_SPEC_0_CV(Trait, Type)
#define true
Definition stdbool.h:25
#define false
Definition stdbool.h:26