Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
3 * Silicon Graphics Computer Systems, Inc.
5 * Permission to use, copy, modify, distribute and sell this software
6 * and its documentation for any purpose is hereby granted without fee,
7 * provided that the above copyright notice appear in all copies and
8 * that both that copyright notice and this permission notice appear
9 * in supporting documentation. Silicon Graphics makes no
10 * representations about the suitability of this software for any
11 * purpose. It is provided "as is" without express or implied warranty.
14 #ifndef __CONCEPT_CHECKS_H
15 #define __CONCEPT_CHECKS_H
18 Use these macro like assertions, but they assert properties
19 on types (usually template arguments). In technical terms they
20 verify whether a type "models" a "concept".
22 This set of requirements and the terminology used here is derived
23 from the book "Generic Programming and the STL" by Matt Austern
24 (Addison Wesley). For further information please consult that
25 book. The requirements also are intended to match the ANSI/ISO C++
28 This file covers the basic concepts and the iterator concepts.
29 There are several other files that provide the requirements
30 for the STL containers:
33 assoc_container_concepts.h
38 - some issues with regards to concept classification and mutability
39 including AssociativeContianer -> ForwardContainer
40 and SortedAssociativeContainer -> ReversibleContainer
41 - HashedAssociativeContainer
43 - Function Object Concepts
47 #ifndef _STLP_USE_CONCEPT_CHECKS
49 // Some compilers lack the features that are necessary for concept checks.
50 // On those compilers we define the concept check macros to do nothing.
51 #define _STLP_REQUIRES(__type_var, __concept) do {} while(0)
52 #define _STLP_CLASS_REQUIRES(__type_var, __concept) \
53 static int __##__type_var##_##__concept
54 #define _STLP_CONVERTIBLE(__type_x, __type_y) do {} while(0)
55 #define _STLP_REQUIRES_SAME_TYPE(__type_x, __type_y) do {} while(0)
56 #define _STLP_CLASS_REQUIRES_SAME_TYPE(__type_x, __type_y) \
57 static int __##__type_x##__type_y##_require_same_type
58 #define _STLP_GENERATOR_CHECK(__func, __ret) do {} while(0)
59 #define _STLP_CLASS_GENERATOR_CHECK(__func, __ret) \
60 static int __##__func##__ret##_generator_check
61 #define _STLP_UNARY_FUNCTION_CHECK(__func, __ret, __arg) do {} while(0)
62 #define _STLP_CLASS_UNARY_FUNCTION_CHECK(__func, __ret, __arg) \
63 static int __##__func##__ret##__arg##_unary_function_check
64 #define _STLP_BINARY_FUNCTION_CHECK(__func, __ret, __first, __second) \
66 #define _STLP_CLASS_BINARY_FUNCTION_CHECK(__func, __ret, __first, __second) \
67 static int __##__func##__ret##__first##__second##_binary_function_check
68 #define _STLP_REQUIRES_BINARY_OP(__opname, __ret, __first, __second) \
70 #define _STLP_CLASS_REQUIRES_BINARY_OP(__opname, __ret, __first, __second) \
71 static int __##__opname##__ret##__first##__second##_require_binary_op
73 #else /* _STLP_USE_CONCEPT_CHECKS */
75 // This macro tests whether the template argument "__type_var"
76 // satisfies the requirements of "__concept". Here is a list of concepts
77 // that we know how to check:
80 // _DefaultConstructible
81 // _EqualityComparable
82 // _LessThanComparable
87 // _BidirectionalIterator
88 // _RandomAccessIterator
89 // _Mutable_TrivialIterator
90 // _Mutable_ForwardIterator
91 // _Mutable_BidirectionalIterator
92 // _Mutable_RandomAccessIterator
94 #define _STLP_REQUIRES(__type_var, __concept) \
96 void (*__x)( __type_var ) = __concept##_concept_specification< __type_var >\
97 ::##__concept##_requirement_violation; __x = __x; } while (0)
99 // Use this to check whether type X is convertible to type Y
100 #define _STLP_CONVERTIBLE(__type_x, __type_y) \
102 void (*__x)( __type_x , __type_y ) = _STL_CONVERT_ERROR< __type_x , \
103 __type_y >::__type_X_is_not_convertible_to_type_Y; \
104 __x = __x; } while (0)
106 // Use this to test whether two template arguments are the same type
107 #define _STLP_REQUIRES_SAME_TYPE(__type_x, __type_y) \
109 void (*__x)( __type_x , __type_y ) = _STL_SAME_TYPE_ERROR< __type_x, \
110 __type_y >::__type_X_not_same_as_type_Y; \
111 __x = __x; } while (0)
114 // function object checks
115 #define _STLP_GENERATOR_CHECK(__func, __ret) \
117 __ret (*__x)( __func&) = \
118 _STL_GENERATOR_ERROR< \
119 __func, __ret>::__generator_requirement_violation; \
120 __x = __x; } while (0)
123 #define _STLP_UNARY_FUNCTION_CHECK(__func, __ret, __arg) \
125 __ret (*__x)( __func&, const __arg& ) = \
126 _STL_UNARY_FUNCTION_ERROR< \
127 __func, __ret, __arg>::__unary_function_requirement_violation; \
128 __x = __x; } while (0)
131 #define _STLP_BINARY_FUNCTION_CHECK(__func, __ret, __first, __second) \
133 __ret (*__x)( __func&, const __first&, const __second& ) = \
134 _STL_BINARY_FUNCTION_ERROR< \
135 __func, __ret, __first, __second>::__binary_function_requirement_violation; \
136 __x = __x; } while (0)
139 #define _STLP_REQUIRES_BINARY_OP(__opname, __ret, __first, __second) \
141 __ret (*__x)( __first&, __second& ) = _STL_BINARY##__opname##_ERROR< \
142 __ret, __first, __second>::__binary_operator_requirement_violation; \
143 __ret (*__y)( const __first&, const __second& ) = \
144 _STL_BINARY##__opname##_ERROR< __ret, __first, __second>:: \
145 __const_binary_operator_requirement_violation; \
146 __y = __y; __x = __x; } while (0)
149 #ifdef _STLP_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE
151 #define _STLP_CLASS_REQUIRES(__type_var, __concept)
152 #define _STLP_CLASS_REQUIRES_SAME_TYPE(__type_x, __type_y)
153 #define _STLP_CLASS_GENERATOR_CHECK(__func, __ret)
154 #define _STLP_CLASS_UNARY_FUNCTION_CHECK(__func, __ret, __arg)
155 #define _STLP_CLASS_BINARY_FUNCTION_CHECK(__func, __ret, __first, __second)
156 #define _STLP_CLASS_REQUIRES_BINARY_OP(__opname, __ret, __first, __second)
160 // Use this macro inside of template classes, where you would
161 // like to place requirements on the template arguments to the class
162 // Warning: do not pass pointers and such (e.g. T*) in as the __type_var,
163 // since the type_var is used to construct identifiers. Instead typedef
164 // the pointer type, then use the typedef name for the __type_var.
165 #define _STLP_CLASS_REQUIRES(__type_var, __concept) \
166 typedef void (* __func##__type_var##__concept)( __type_var ); \
167 template <__func##__type_var##__concept _Tp1> \
168 struct __dummy_struct_##__type_var##__concept { }; \
169 static __dummy_struct_##__type_var##__concept< \
170 __concept##_concept_specification< \
171 __type_var>::__concept##_requirement_violation> \
172 __dummy_ptr_##__type_var##__concept
175 #define _STLP_CLASS_REQUIRES_SAME_TYPE(__type_x, __type_y) \
176 typedef void (* __func_##__type_x##__type_y##same_type)( __type_x, \
178 template < __func_##__type_x##__type_y##same_type _Tp1> \
179 struct __dummy_struct_##__type_x##__type_y##_same_type { }; \
180 static __dummy_struct_##__type_x##__type_y##_same_type< \
181 _STL_SAME_TYPE_ERROR<__type_x, __type_y>::__type_X_not_same_as_type_Y> \
182 __dummy_ptr_##__type_x##__type_y##_same_type
185 #define _STLP_CLASS_GENERATOR_CHECK(__func, __ret) \
186 typedef __ret (* __f_##__func##__ret##_generator)( __func& ); \
187 template <__f_##__func##__ret##_generator _Tp1> \
188 struct __dummy_struct_##__func##__ret##_generator { }; \
189 static __dummy_struct_##__func##__ret##_generator< \
190 _STL_GENERATOR_ERROR< \
191 __func, __ret>::__generator_requirement_violation> \
192 __dummy_ptr_##__func##__ret##_generator
195 #define _STLP_CLASS_UNARY_FUNCTION_CHECK(__func, __ret, __arg) \
196 typedef __ret (* __f_##__func##__ret##__arg##_unary_check)( __func&, \
198 template <__f_##__func##__ret##__arg##_unary_check _Tp1> \
199 struct __dummy_struct_##__func##__ret##__arg##_unary_check { }; \
200 static __dummy_struct_##__func##__ret##__arg##_unary_check< \
201 _STL_UNARY_FUNCTION_ERROR< \
202 __func, __ret, __arg>::__unary_function_requirement_violation> \
203 __dummy_ptr_##__func##__ret##__arg##_unary_check
206 #define _STLP_CLASS_BINARY_FUNCTION_CHECK(__func, __ret, __first, __second) \
207 typedef __ret (* __f_##__func##__ret##__first##__second##_binary_check)( __func&, const __first&,\
209 template <__f_##__func##__ret##__first##__second##_binary_check _Tp1> \
210 struct __dummy_struct_##__func##__ret##__first##__second##_binary_check { }; \
211 static __dummy_struct_##__func##__ret##__first##__second##_binary_check< \
212 _STL_BINARY_FUNCTION_ERROR<__func, __ret, __first, __second>:: \
213 __binary_function_requirement_violation> \
214 __dummy_ptr_##__func##__ret##__first##__second##_binary_check
217 #define _STLP_CLASS_REQUIRES_BINARY_OP(__opname, __ret, __first, __second) \
218 typedef __ret (* __f_##__func##__ret##__first##__second##_binary_op)(const __first&, \
220 template <__f_##__func##__ret##__first##__second##_binary_op _Tp1> \
221 struct __dummy_struct_##__func##__ret##__first##__second##_binary_op { }; \
222 static __dummy_struct_##__func##__ret##__first##__second##_binary_op< \
223 _STL_BINARY##__opname##_ERROR<__ret, __first, __second>:: \
224 __binary_operator_requirement_violation> \
225 __dummy_ptr_##__func##__ret##__first##__second##_binary_op
229 /* helper class for finding non-const version of a type. Need to have
230 something to assign to etc. when testing constant iterators. */
233 struct _Mutable_trait {
237 struct _Mutable_trait<const _Tp> {
242 /* helper function for avoiding compiler warnings about unused variables */
243 template <class _Type>
244 void __sink_unused_warning(_Type) { }
246 template <class _TypeX, class _TypeY>
247 struct _STL_CONVERT_ERROR {
249 __type_X_is_not_convertible_to_type_Y(_TypeX __x, _TypeY) {
251 __sink_unused_warning(__y);
256 template <class _Type> struct __check_equal { };
258 template <class _TypeX, class _TypeY>
259 struct _STL_SAME_TYPE_ERROR {
261 __type_X_not_same_as_type_Y(_TypeX , _TypeY ) {
262 __check_equal<_TypeX> t1 = __check_equal<_TypeY>();
267 // Some Functon Object Checks
269 template <class _Func, class _Ret>
270 struct _STL_GENERATOR_ERROR {
271 static _Ret __generator_requirement_violation(_Func& __f) {
276 template <class _Func>
277 struct _STL_GENERATOR_ERROR<_Func, void> {
278 static void __generator_requirement_violation(_Func& __f) {
284 template <class _Func, class _Ret, class _Arg>
285 struct _STL_UNARY_FUNCTION_ERROR {
287 __unary_function_requirement_violation(_Func& __f,
293 template <class _Func, class _Arg>
294 struct _STL_UNARY_FUNCTION_ERROR<_Func, void, _Arg> {
296 __unary_function_requirement_violation(_Func& __f,
302 template <class _Func, class _Ret, class _First, class _Second>
303 struct _STL_BINARY_FUNCTION_ERROR {
305 __binary_function_requirement_violation(_Func& __f,
306 const _First& __first,
307 const _Second& __second) {
308 return __f(__first, __second);
312 template <class _Func, class _First, class _Second>
313 struct _STL_BINARY_FUNCTION_ERROR<_Func, void, _First, _Second> {
315 __binary_function_requirement_violation(_Func& __f,
316 const _First& __first,
317 const _Second& __second) {
318 __f(__first, __second);
323 #define _STLP_DEFINE_BINARY_OP_CHECK(_OP, _NAME) \
324 template <class _Ret, class _First, class _Second> \
325 struct _STL_BINARY##_NAME##_ERROR { \
327 __const_binary_operator_requirement_violation(const _First& __first, \
328 const _Second& __second) { \
329 return __first _OP __second; \
332 __binary_operator_requirement_violation(_First& __first, \
333 _Second& __second) { \
334 return __first _OP __second; \
338 _STLP_DEFINE_BINARY_OP_CHECK(==, _OP_EQUAL);
339 _STLP_DEFINE_BINARY_OP_CHECK(!=, _OP_NOT_EQUAL);
340 _STLP_DEFINE_BINARY_OP_CHECK(<, _OP_LESS_THAN);
341 _STLP_DEFINE_BINARY_OP_CHECK(<=, _OP_LESS_EQUAL);
342 _STLP_DEFINE_BINARY_OP_CHECK(>, _OP_GREATER_THAN);
343 _STLP_DEFINE_BINARY_OP_CHECK(>=, _OP_GREATER_EQUAL);
344 _STLP_DEFINE_BINARY_OP_CHECK(+, _OP_PLUS);
345 _STLP_DEFINE_BINARY_OP_CHECK(*, _OP_TIMES);
346 _STLP_DEFINE_BINARY_OP_CHECK(/, _OP_DIVIDE);
347 _STLP_DEFINE_BINARY_OP_CHECK(-, _OP_SUBTRACT);
348 _STLP_DEFINE_BINARY_OP_CHECK(%, _OP_MOD);
351 // TODO, add unary operators (prefix and postfix)
354 The presence of this class is just to trick EDG into displaying
355 these error messages before any other errors. Without the
356 classes, the errors in the functions get reported after
357 other class errors deep inside the library. The name
358 choice just makes for an eye catching error message :)
362 template <class _Type>
364 __default_constructor_requirement_violation(_Type) {
367 template <class _Type>
369 __assignment_operator_requirement_violation(_Type __a) {
373 template <class _Type>
375 __copy_constructor_requirement_violation(_Type __a) {
379 template <class _Type>
381 __const_parameter_required_for_copy_constructor(_Type /* __a */,
386 template <class _Type>
388 __const_parameter_required_for_assignment_operator(_Type __a,
393 template <class _Type>
395 __less_than_comparable_requirement_violation(_Type __a, _Type __b) {
396 if (__a < __b || __a > __b || __a <= __b || __a >= __b) return __a;
399 template <class _Type>
401 __equality_comparable_requirement_violation(_Type __a, _Type __b) {
402 if (__a == __b || __a != __b) return __a;
405 template <class _Iterator>
407 __dereference_operator_requirement_violation(_Iterator __i) {
408 __sink_unused_warning(*__i);
410 template <class _Iterator>
412 __dereference_operator_and_assignment_requirement_violation(_Iterator __i) {
415 template <class _Iterator>
417 __preincrement_operator_requirement_violation(_Iterator __i) {
420 template <class _Iterator>
422 __postincrement_operator_requirement_violation(_Iterator __i) {
425 template <class _Iterator>
427 __predecrement_operator_requirement_violation(_Iterator __i) {
430 template <class _Iterator>
432 __postdecrement_operator_requirement_violation(_Iterator __i) {
435 template <class _Iterator, class _Type>
437 __postincrement_operator_and_assignment_requirement_violation(_Iterator __i,
441 template <class _Iterator, class _Distance>
443 __iterator_addition_assignment_requirement_violation(_Iterator __i,
448 template <class _Iterator, class _Distance>
450 __iterator_addition_requirement_violation(_Iterator __i, _Distance __n) {
455 template <class _Iterator, class _Distance>
457 __iterator_subtraction_assignment_requirement_violation(_Iterator __i,
462 template <class _Iterator, class _Distance>
464 __iterator_subtraction_requirement_violation(_Iterator __i, _Distance __n) {
468 template <class _Iterator, class _Distance>
470 __difference_operator_requirement_violation(_Iterator __i, _Iterator __j,
475 template <class _Exp, class _Type, class _Distance>
477 __element_access_operator_requirement_violation(_Exp __x, _Type*,
481 template <class _Exp, class _Type, class _Distance>
483 __element_assignment_operator_requirement_violation(_Exp __x,
491 /* Associated Type Requirements */
493 _STLP_BEGIN_NAMESPACE
494 template <class _Iterator> struct iterator_traits;
497 template <class _Iter>
498 struct __value_type_type_definition_requirement_violation {
499 typedef typename __STD::iterator_traits<_Iter>::value_type value_type;
502 template <class _Iter>
503 struct __difference_type_type_definition_requirement_violation {
504 typedef typename __STD::iterator_traits<_Iter>::difference_type
508 template <class _Iter>
509 struct __reference_type_definition_requirement_violation {
510 typedef typename __STD::iterator_traits<_Iter>::reference reference;
513 template <class _Iter>
514 struct __pointer_type_definition_requirement_violation {
515 typedef typename __STD::iterator_traits<_Iter>::pointer pointer;
518 template <class _Iter>
519 struct __iterator_category_type_definition_requirement_violation {
520 typedef typename __STD::iterator_traits<_Iter>::iterator_category
524 /* Assignable Requirements */
527 template <class _Type>
528 struct _Assignable_concept_specification {
529 static void _Assignable_requirement_violation(_Type __a) {
530 _STL_ERROR::__assignment_operator_requirement_violation(__a);
531 _STL_ERROR::__copy_constructor_requirement_violation(__a);
532 _STL_ERROR::__const_parameter_required_for_copy_constructor(__a,__a);
533 _STL_ERROR::__const_parameter_required_for_assignment_operator(__a,__a);
537 /* DefaultConstructible Requirements */
540 template <class _Type>
541 struct _DefaultConstructible_concept_specification {
542 static void _DefaultConstructible_requirement_violation(_Type __a) {
543 _STL_ERROR::__default_constructor_requirement_violation(__a);
547 /* EqualityComparable Requirements */
549 template <class _Type>
550 struct _EqualityComparable_concept_specification {
551 static void _EqualityComparable_requirement_violation(_Type __a) {
552 _STL_ERROR::__equality_comparable_requirement_violation(__a, __a);
556 /* LessThanComparable Requirements */
557 template <class _Type>
558 struct _LessThanComparable_concept_specification {
559 static void _LessThanComparable_requirement_violation(_Type __a) {
560 _STL_ERROR::__less_than_comparable_requirement_violation(__a, __a);
564 /* TrivialIterator Requirements */
566 template <class _TrivialIterator>
567 struct _TrivialIterator_concept_specification {
569 _TrivialIterator_requirement_violation(_TrivialIterator __i) {
571 __value_type_type_definition_requirement_violation<_TrivialIterator>::
573 // Refinement of Assignable
574 _Assignable_concept_specification<_TrivialIterator>::
575 _Assignable_requirement_violation(__i);
576 // Refinement of DefaultConstructible
577 _DefaultConstructible_concept_specification<_TrivialIterator>::
578 _DefaultConstructible_requirement_violation(__i);
579 // Refinement of EqualityComparable
580 _EqualityComparable_concept_specification<_TrivialIterator>::
581 _EqualityComparable_requirement_violation(__i);
583 _STL_ERROR::__dereference_operator_requirement_violation(__i);
587 template <class _TrivialIterator>
588 struct _Mutable_TrivialIterator_concept_specification {
590 _Mutable_TrivialIterator_requirement_violation(_TrivialIterator __i) {
591 _TrivialIterator_concept_specification<_TrivialIterator>::
592 _TrivialIterator_requirement_violation(__i);
594 _STL_ERROR::__dereference_operator_and_assignment_requirement_violation(__i);
598 /* InputIterator Requirements */
600 template <class _InputIterator>
601 struct _InputIterator_concept_specification {
603 _InputIterator_requirement_violation(_InputIterator __i) {
604 // Refinement of TrivialIterator
605 _TrivialIterator_concept_specification<_InputIterator>::
606 _TrivialIterator_requirement_violation(__i);
608 __difference_type_type_definition_requirement_violation<_InputIterator>();
609 __reference_type_definition_requirement_violation<_InputIterator>();
610 __pointer_type_definition_requirement_violation<_InputIterator>();
611 __iterator_category_type_definition_requirement_violation<_InputIterator>();
613 _STL_ERROR::__preincrement_operator_requirement_violation(__i);
614 _STL_ERROR::__postincrement_operator_requirement_violation(__i);
618 /* OutputIterator Requirements */
620 template <class _OutputIterator>
621 struct _OutputIterator_concept_specification {
623 _OutputIterator_requirement_violation(_OutputIterator __i) {
624 // Refinement of Assignable
625 _Assignable_concept_specification<_OutputIterator>::
626 _Assignable_requirement_violation(__i);
628 __iterator_category_type_definition_requirement_violation<_OutputIterator>();
630 _STL_ERROR::__dereference_operator_requirement_violation(__i);
631 _STL_ERROR::__preincrement_operator_requirement_violation(__i);
632 _STL_ERROR::__postincrement_operator_requirement_violation(__i);
634 __postincrement_operator_and_assignment_requirement_violation(__i, *__i);
638 /* ForwardIterator Requirements */
640 template <class _ForwardIterator>
641 struct _ForwardIterator_concept_specification {
643 _ForwardIterator_requirement_violation(_ForwardIterator __i) {
644 // Refinement of InputIterator
645 _InputIterator_concept_specification<_ForwardIterator>::
646 _InputIterator_requirement_violation(__i);
650 template <class _ForwardIterator>
651 struct _Mutable_ForwardIterator_concept_specification {
653 _Mutable_ForwardIterator_requirement_violation(_ForwardIterator __i) {
654 _ForwardIterator_concept_specification<_ForwardIterator>::
655 _ForwardIterator_requirement_violation(__i);
656 // Refinement of OutputIterator
657 _OutputIterator_concept_specification<_ForwardIterator>::
658 _OutputIterator_requirement_violation(__i);
662 /* BidirectionalIterator Requirements */
664 template <class _BidirectionalIterator>
665 struct _BidirectionalIterator_concept_specification {
667 _BidirectionalIterator_requirement_violation(_BidirectionalIterator __i) {
668 // Refinement of ForwardIterator
669 _ForwardIterator_concept_specification<_BidirectionalIterator>::
670 _ForwardIterator_requirement_violation(__i);
672 _STL_ERROR::__predecrement_operator_requirement_violation(__i);
673 _STL_ERROR::__postdecrement_operator_requirement_violation(__i);
677 template <class _BidirectionalIterator>
678 struct _Mutable_BidirectionalIterator_concept_specification {
680 _Mutable_BidirectionalIterator_requirement_violation(
681 _BidirectionalIterator __i)
683 _BidirectionalIterator_concept_specification<_BidirectionalIterator>::
684 _BidirectionalIterator_requirement_violation(__i);
685 // Refinement of mutable_ForwardIterator
686 _Mutable_ForwardIterator_concept_specification<_BidirectionalIterator>::
687 _Mutable_ForwardIterator_requirement_violation(__i);
689 __value_type_type_definition_requirement_violation<
690 _BidirectionalIterator>::value_type __T;
691 typename _Mutable_trait<__T>::_Type* __tmp_ptr = 0;
694 __postincrement_operator_and_assignment_requirement_violation(__i,
699 /* RandomAccessIterator Requirements */
701 template <class _RandAccIter>
702 struct _RandomAccessIterator_concept_specification {
704 _RandomAccessIterator_requirement_violation(_RandAccIter __i) {
705 // Refinement of BidirectionalIterator
706 _BidirectionalIterator_concept_specification<_RandAccIter>::
707 _BidirectionalIterator_requirement_violation(__i);
708 // Refinement of LessThanComparable
709 _LessThanComparable_concept_specification<_RandAccIter>::
710 _LessThanComparable_requirement_violation(__i);
712 __value_type_type_definition_requirement_violation<_RandAccIter>
716 __difference_type_type_definition_requirement_violation<_RandAccIter>
719 typedef typename _Mutable_trait<_Dist>::_Type _MutDist;
722 _STL_ERROR::__iterator_addition_assignment_requirement_violation(__i,
724 _STL_ERROR::__iterator_addition_requirement_violation(__i,
727 __iterator_subtraction_assignment_requirement_violation(__i,
729 _STL_ERROR::__iterator_subtraction_requirement_violation(__i,
731 _STL_ERROR::__difference_operator_requirement_violation(__i, __i,
733 typename _Mutable_trait<value_type>::_Type* __dummy_ptr = 0;
734 _STL_ERROR::__element_access_operator_requirement_violation(__i,
740 template <class _RandAccIter>
741 struct _Mutable_RandomAccessIterator_concept_specification {
743 _Mutable_RandomAccessIterator_requirement_violation(_RandAccIter __i)
745 _RandomAccessIterator_concept_specification<_RandAccIter>::
746 _RandomAccessIterator_requirement_violation(__i);
747 // Refinement of mutable_BidirectionalIterator
748 _Mutable_BidirectionalIterator_concept_specification<_RandAccIter>::
749 _Mutable_BidirectionalIterator_requirement_violation(__i);
751 __value_type_type_definition_requirement_violation<_RandAccIter>
755 __difference_type_type_definition_requirement_violation<_RandAccIter>
759 typename _Mutable_trait<value_type>::_Type* __tmp_ptr = 0;
761 _STL_ERROR::__element_assignment_operator_requirement_violation(__i,
766 #define _STLP_TYPEDEF_REQUIREMENT(__REQUIREMENT) \
767 template <class Type> \
768 struct __##__REQUIREMENT##__typedef_requirement_violation { \
769 typedef typename Type::__REQUIREMENT __REQUIREMENT; \
772 _STLP_TYPEDEF_REQUIREMENT(value_type);
773 _STLP_TYPEDEF_REQUIREMENT(difference_type);
774 _STLP_TYPEDEF_REQUIREMENT(size_type);
775 _STLP_TYPEDEF_REQUIREMENT(reference);
776 _STLP_TYPEDEF_REQUIREMENT(const_reference);
777 _STLP_TYPEDEF_REQUIREMENT(pointer);
778 _STLP_TYPEDEF_REQUIREMENT(const_pointer);
781 template <class _Alloc>
782 struct _Allocator_concept_specification {
784 _Allocator_requirement_violation(_Alloc __a) {
785 // Refinement of DefaultConstructible
786 _DefaultConstructible_concept_specification<_Alloc>::
787 _DefaultConstructible_requirement_violation(__a);
788 // Refinement of EqualityComparable
789 _EqualityComparable_concept_specification<_Alloc>::
790 _EqualityComparable_requirement_violation(__a);
792 __value_type__typedef_requirement_violation<_Alloc>();
793 __difference_type__typedef_requirement_violation<_Alloc>();
794 __size_type__typedef_requirement_violation<_Alloc>();
795 __reference__typedef_requirement_violation<_Alloc>();
796 __const_reference__typedef_requirement_violation<_Alloc>();
797 __pointer__typedef_requirement_violation<_Alloc>();
798 __const_pointer__typedef_requirement_violation<_Alloc>();
799 typedef typename _Alloc::value_type _Type;
800 _STLP_REQUIRES_SAME_TYPE(typename _Alloc::rebind<_Type>::other, _Alloc);
804 #endif /* _STLP_USE_CONCEPT_CHECKS */
806 #endif /* __CONCEPT_CHECKS_H */