3 // Copyright (C) 2004-2016 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
25 // (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
26 // sell and distribute this software is granted provided this
27 // copyright notice appears in all copies. This software is provided
28 // "as is" without express or implied warranty, and with no claim as
29 // to its suitability for any purpose.
32 /** @file bits/boost_concept_check.h
33 * This is an internal header file, included by other library headers.
34 * Do not attempt to use it directly. @headername{iterator}
37 // GCC Note: based on version 1.12.0 of the Boost library.
39 #ifndef _BOOST_CONCEPT_CHECK_H
40 #define _BOOST_CONCEPT_CHECK_H 1
42 #pragma GCC system_header
44 #include <bits/c++config.h>
45 #include <bits/stl_iterator_base_types.h> // for traits and tags
47 namespace __gnu_cxx
_GLIBCXX_VISIBILITY(default)
49 _GLIBCXX_BEGIN_NAMESPACE_VERSION
51 #define _IsUnused __attribute__ ((__unused__))
53 // When the C-C code is in use, we would like this function to do as little
54 // as possible at runtime, use as few resources as possible, and hopefully
55 // be elided out of existence... hmmm.
56 template <class _Concept
>
57 inline void __function_requires()
59 void (_Concept::*__x
)() _IsUnused
= &_Concept::__constraints
;
62 // No definition: if this is referenced, there's a problem with
63 // the instantiating type not being one of the required integer types.
64 // Unfortunately, this results in a link-time error, not a compile-time error.
65 void __error_type_must_be_an_integer_type();
66 void __error_type_must_be_an_unsigned_integer_type();
67 void __error_type_must_be_a_signed_integer_type();
69 // ??? Should the "concept_checking*" structs begin with more than _ ?
70 #define _GLIBCXX_CLASS_REQUIRES(_type_var, _ns, _concept) \
71 typedef void (_ns::_concept <_type_var>::* _func##_type_var##_concept)(); \
72 template <_func##_type_var##_concept _Tp1> \
73 struct _concept_checking##_type_var##_concept { }; \
74 typedef _concept_checking##_type_var##_concept< \
75 &_ns::_concept <_type_var>::__constraints> \
76 _concept_checking_typedef##_type_var##_concept
78 #define _GLIBCXX_CLASS_REQUIRES2(_type_var1, _type_var2, _ns, _concept) \
79 typedef void (_ns::_concept <_type_var1,_type_var2>::* _func##_type_var1##_type_var2##_concept)(); \
80 template <_func##_type_var1##_type_var2##_concept _Tp1> \
81 struct _concept_checking##_type_var1##_type_var2##_concept { }; \
82 typedef _concept_checking##_type_var1##_type_var2##_concept< \
83 &_ns::_concept <_type_var1,_type_var2>::__constraints> \
84 _concept_checking_typedef##_type_var1##_type_var2##_concept
86 #define _GLIBCXX_CLASS_REQUIRES3(_type_var1, _type_var2, _type_var3, _ns, _concept) \
87 typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3>::* _func##_type_var1##_type_var2##_type_var3##_concept)(); \
88 template <_func##_type_var1##_type_var2##_type_var3##_concept _Tp1> \
89 struct _concept_checking##_type_var1##_type_var2##_type_var3##_concept { }; \
90 typedef _concept_checking##_type_var1##_type_var2##_type_var3##_concept< \
91 &_ns::_concept <_type_var1,_type_var2,_type_var3>::__constraints> \
92 _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_concept
94 #define _GLIBCXX_CLASS_REQUIRES4(_type_var1, _type_var2, _type_var3, _type_var4, _ns, _concept) \
95 typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::* _func##_type_var1##_type_var2##_type_var3##_type_var4##_concept)(); \
96 template <_func##_type_var1##_type_var2##_type_var3##_type_var4##_concept _Tp1> \
97 struct _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept { }; \
98 typedef _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept< \
99 &_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::__constraints> \
100 _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_type_var4##_concept
103 template <class _Tp1
, class _Tp2
>
104 struct _Aux_require_same
{ };
107 struct _Aux_require_same
<_Tp
,_Tp
> { typedef _Tp _Type
; };
109 template <class _Tp1
, class _Tp2
>
110 struct _SameTypeConcept
112 void __constraints() {
113 typedef typename _Aux_require_same
<_Tp1
, _Tp2
>::_Type _Required
;
118 struct _IntegerConcept
{
119 void __constraints() {
120 __error_type_must_be_an_integer_type();
123 template <> struct _IntegerConcept
<short> { void __constraints() {} };
124 template <> struct _IntegerConcept
<unsigned short> { void __constraints(){} };
125 template <> struct _IntegerConcept
<int> { void __constraints() {} };
126 template <> struct _IntegerConcept
<unsigned int> { void __constraints() {} };
127 template <> struct _IntegerConcept
<long> { void __constraints() {} };
128 template <> struct _IntegerConcept
<unsigned long> { void __constraints() {} };
129 template <> struct _IntegerConcept
<long long> { void __constraints() {} };
130 template <> struct _IntegerConcept
<unsigned long long>
131 { void __constraints() {} };
134 struct _SignedIntegerConcept
{
135 void __constraints() {
136 __error_type_must_be_a_signed_integer_type();
139 template <> struct _SignedIntegerConcept
<short> { void __constraints() {} };
140 template <> struct _SignedIntegerConcept
<int> { void __constraints() {} };
141 template <> struct _SignedIntegerConcept
<long> { void __constraints() {} };
142 template <> struct _SignedIntegerConcept
<long long> { void __constraints(){}};
145 struct _UnsignedIntegerConcept
{
146 void __constraints() {
147 __error_type_must_be_an_unsigned_integer_type();
150 template <> struct _UnsignedIntegerConcept
<unsigned short>
151 { void __constraints() {} };
152 template <> struct _UnsignedIntegerConcept
<unsigned int>
153 { void __constraints() {} };
154 template <> struct _UnsignedIntegerConcept
<unsigned long>
155 { void __constraints() {} };
156 template <> struct _UnsignedIntegerConcept
<unsigned long long>
157 { void __constraints() {} };
159 //===========================================================================
163 struct _DefaultConstructibleConcept
165 void __constraints() {
166 _Tp __a _IsUnused
; // require default constructor
171 struct _AssignableConcept
173 void __constraints() {
174 __a
= __a
; // require assignment operator
175 __const_constraints(__a
);
177 void __const_constraints(const _Tp
& __b
) {
178 __a
= __b
; // const required for argument to assignment
181 // possibly should be "Tp* a;" and then dereference "a" in constraint
182 // functions? present way would require a default ctor, i think...
186 struct _CopyConstructibleConcept
188 void __constraints() {
189 _Tp
__a(__b
); // require copy constructor
190 _Tp
* __ptr _IsUnused
= &__a
; // require address of operator
191 __const_constraints(__a
);
193 void __const_constraints(const _Tp
& __a
) {
194 _Tp __c
_IsUnused(__a
); // require const copy constructor
195 const _Tp
* __ptr _IsUnused
= &__a
; // require const address of operator
200 // The SGI STL version of Assignable requires copy constructor and operator=
202 struct _SGIAssignableConcept
204 void __constraints() {
205 _Tp __b
_IsUnused(__a
);
206 __a
= __a
; // require assignment operator
207 __const_constraints(__a
);
209 void __const_constraints(const _Tp
& __b
) {
210 _Tp __c
_IsUnused(__b
);
211 __a
= __b
; // const required for argument to assignment
216 template <class _From
, class _To
>
217 struct _ConvertibleConcept
219 void __constraints() {
220 _To __y _IsUnused
= __x
;
225 // The C++ standard requirements for many concepts talk about return
226 // types that must be "convertible to bool". The problem with this
227 // requirement is that it leaves the door open for evil proxies that
228 // define things like operator|| with strange return types. Two
229 // possible solutions are:
230 // 1) require the return type to be exactly bool
231 // 2) stay with convertible to bool, and also
232 // specify stuff about all the logical operators.
233 // For now we just test for convertible to bool.
235 void __aux_require_boolean_expr(const _Tp
& __t
) {
236 bool __x _IsUnused
= __t
;
241 struct _EqualityComparableConcept
243 void __constraints() {
244 __aux_require_boolean_expr(__a
== __b
);
250 struct _LessThanComparableConcept
252 void __constraints() {
253 __aux_require_boolean_expr(__a
< __b
);
258 // This is equivalent to SGI STL's LessThanComparable.
260 struct _ComparableConcept
262 void __constraints() {
263 __aux_require_boolean_expr(__a
< __b
);
264 __aux_require_boolean_expr(__a
> __b
);
265 __aux_require_boolean_expr(__a
<= __b
);
266 __aux_require_boolean_expr(__a
>= __b
);
271 #define _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(_OP,_NAME) \
272 template <class _First, class _Second> \
274 void __constraints() { (void)__constraints_(); } \
275 bool __constraints_() { \
276 return __a _OP __b; \
282 #define _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(_OP,_NAME) \
283 template <class _Ret, class _First, class _Second> \
285 void __constraints() { (void)__constraints_(); } \
286 _Ret __constraints_() { \
287 return __a _OP __b; \
293 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(==, _EqualOpConcept
);
294 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(!=, _NotEqualOpConcept
);
295 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<, _LessThanOpConcept
);
296 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<=, _LessEqualOpConcept
);
297 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>, _GreaterThanOpConcept
);
298 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>=, _GreaterEqualOpConcept
);
300 _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(+, _PlusOpConcept
);
301 _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(*, _TimesOpConcept
);
302 _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(/, _DivideOpConcept
);
303 _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, _SubtractOpConcept
);
304 _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, _ModOpConcept
);
306 #undef _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT
307 #undef _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT
309 //===========================================================================
310 // Function Object Concepts
312 template <class _Func
, class _Return
>
313 struct _GeneratorConcept
315 void __constraints() {
316 const _Return
& __r _IsUnused
= __f();// require operator() member function
322 template <class _Func
>
323 struct _GeneratorConcept
<_Func
,void>
325 void __constraints() {
326 __f(); // require operator() member function
331 template <class _Func
, class _Return
, class _Arg
>
332 struct _UnaryFunctionConcept
334 void __constraints() {
335 __r
= __f(__arg
); // require operator()
342 template <class _Func
, class _Arg
>
343 struct _UnaryFunctionConcept
<_Func
, void, _Arg
> {
344 void __constraints() {
345 __f(__arg
); // require operator()
351 template <class _Func
, class _Return
, class _First
, class _Second
>
352 struct _BinaryFunctionConcept
354 void __constraints() {
355 __r
= __f(__first
, __second
); // require operator()
363 template <class _Func
, class _First
, class _Second
>
364 struct _BinaryFunctionConcept
<_Func
, void, _First
, _Second
>
366 void __constraints() {
367 __f(__first
, __second
); // require operator()
374 template <class _Func
, class _Arg
>
375 struct _UnaryPredicateConcept
377 void __constraints() {
378 __aux_require_boolean_expr(__f(__arg
)); // require op() returning bool
384 template <class _Func
, class _First
, class _Second
>
385 struct _BinaryPredicateConcept
387 void __constraints() {
388 __aux_require_boolean_expr(__f(__a
, __b
)); // require op() returning bool
395 // use this when functor is used inside a container class like std::set
396 template <class _Func
, class _First
, class _Second
>
397 struct _Const_BinaryPredicateConcept
{
398 void __constraints() {
399 __const_constraints(__f
);
401 void __const_constraints(const _Func
& __fun
) {
402 __function_requires
<_BinaryPredicateConcept
<_Func
, _First
, _Second
> >();
403 // operator() must be a const member function
404 __aux_require_boolean_expr(__fun(__a
, __b
));
411 //===========================================================================
415 struct _TrivialIteratorConcept
417 void __constraints() {
418 // __function_requires< _DefaultConstructibleConcept<_Tp> >();
419 __function_requires
< _AssignableConcept
<_Tp
> >();
420 __function_requires
< _EqualityComparableConcept
<_Tp
> >();
421 // typedef typename std::iterator_traits<_Tp>::value_type _V;
422 (void)*__i
; // require dereference operator
428 struct _Mutable_TrivialIteratorConcept
430 void __constraints() {
431 __function_requires
< _TrivialIteratorConcept
<_Tp
> >();
432 *__i
= *__j
; // require dereference and assignment
438 struct _InputIteratorConcept
440 void __constraints() {
441 __function_requires
< _TrivialIteratorConcept
<_Tp
> >();
442 // require iterator_traits typedef's
443 typedef typename
std::iterator_traits
<_Tp
>::difference_type _Diff
;
444 // __function_requires< _SignedIntegerConcept<_Diff> >();
445 typedef typename
std::iterator_traits
<_Tp
>::reference _Ref
;
446 typedef typename
std::iterator_traits
<_Tp
>::pointer _Pt
;
447 typedef typename
std::iterator_traits
<_Tp
>::iterator_category _Cat
;
448 __function_requires
< _ConvertibleConcept
<
449 typename
std::iterator_traits
<_Tp
>::iterator_category
,
450 std::input_iterator_tag
> >();
451 ++__i
; // require preincrement operator
452 __i
++; // require postincrement operator
457 template <class _Tp
, class _ValueT
>
458 struct _OutputIteratorConcept
460 void __constraints() {
461 __function_requires
< _AssignableConcept
<_Tp
> >();
462 ++__i
; // require preincrement operator
463 __i
++; // require postincrement operator
464 *__i
++ = __t
; // require postincrement and assignment
471 struct _ForwardIteratorConcept
473 void __constraints() {
474 __function_requires
< _InputIteratorConcept
<_Tp
> >();
475 __function_requires
< _DefaultConstructibleConcept
<_Tp
> >();
476 __function_requires
< _ConvertibleConcept
<
477 typename
std::iterator_traits
<_Tp
>::iterator_category
,
478 std::forward_iterator_tag
> >();
479 typedef typename
std::iterator_traits
<_Tp
>::reference _Ref
;
480 _Ref __r _IsUnused
= *__i
;
486 struct _Mutable_ForwardIteratorConcept
488 void __constraints() {
489 __function_requires
< _ForwardIteratorConcept
<_Tp
> >();
490 *__i
++ = *__i
; // require postincrement and assignment
496 struct _BidirectionalIteratorConcept
498 void __constraints() {
499 __function_requires
< _ForwardIteratorConcept
<_Tp
> >();
500 __function_requires
< _ConvertibleConcept
<
501 typename
std::iterator_traits
<_Tp
>::iterator_category
,
502 std::bidirectional_iterator_tag
> >();
503 --__i
; // require predecrement operator
504 __i
--; // require postdecrement operator
510 struct _Mutable_BidirectionalIteratorConcept
512 void __constraints() {
513 __function_requires
< _BidirectionalIteratorConcept
<_Tp
> >();
514 __function_requires
< _Mutable_ForwardIteratorConcept
<_Tp
> >();
515 *__i
-- = *__i
; // require postdecrement and assignment
522 struct _RandomAccessIteratorConcept
524 void __constraints() {
525 __function_requires
< _BidirectionalIteratorConcept
<_Tp
> >();
526 __function_requires
< _ComparableConcept
<_Tp
> >();
527 __function_requires
< _ConvertibleConcept
<
528 typename
std::iterator_traits
<_Tp
>::iterator_category
,
529 std::random_access_iterator_tag
> >();
530 // ??? We don't use _Ref, are we just checking for "referenceability"?
531 typedef typename
std::iterator_traits
<_Tp
>::reference _Ref
;
533 __i
+= __n
; // require assignment addition operator
534 __i
= __i
+ __n
; __i
= __n
+ __i
; // require addition with difference type
535 __i
-= __n
; // require assignment subtraction op
536 __i
= __i
- __n
; // require subtraction with
538 __n
= __i
- __j
; // require difference operator
539 (void)__i
[__n
]; // require element access operator
543 typename
std::iterator_traits
<_Tp
>::difference_type __n
;
547 struct _Mutable_RandomAccessIteratorConcept
549 void __constraints() {
550 __function_requires
< _RandomAccessIteratorConcept
<_Tp
> >();
551 __function_requires
< _Mutable_BidirectionalIteratorConcept
<_Tp
> >();
552 __i
[__n
] = *__i
; // require element access and assignment
555 typename
std::iterator_traits
<_Tp
>::difference_type __n
;
558 //===========================================================================
559 // Container Concepts
561 template <class _Container
>
562 struct _ContainerConcept
564 typedef typename
_Container::value_type _Value_type
;
565 typedef typename
_Container::difference_type _Difference_type
;
566 typedef typename
_Container::size_type _Size_type
;
567 typedef typename
_Container::const_reference _Const_reference
;
568 typedef typename
_Container::const_pointer _Const_pointer
;
569 typedef typename
_Container::const_iterator _Const_iterator
;
571 void __constraints() {
572 __function_requires
< _InputIteratorConcept
<_Const_iterator
> >();
573 __function_requires
< _AssignableConcept
<_Container
> >();
574 const _Container __c
;
578 __n
= __c
.max_size();
586 template <class _Container
>
587 struct _Mutable_ContainerConcept
589 typedef typename
_Container::value_type _Value_type
;
590 typedef typename
_Container::reference _Reference
;
591 typedef typename
_Container::iterator _Iterator
;
592 typedef typename
_Container::pointer _Pointer
;
594 void __constraints() {
595 __function_requires
< _ContainerConcept
<_Container
> >();
596 __function_requires
< _AssignableConcept
<_Value_type
> >();
597 __function_requires
< _InputIteratorConcept
<_Iterator
> >();
604 _Container __c
, __c2
;
607 template <class _ForwardContainer
>
608 struct _ForwardContainerConcept
610 void __constraints() {
611 __function_requires
< _ContainerConcept
<_ForwardContainer
> >();
612 typedef typename
_ForwardContainer::const_iterator _Const_iterator
;
613 __function_requires
< _ForwardIteratorConcept
<_Const_iterator
> >();
617 template <class _ForwardContainer
>
618 struct _Mutable_ForwardContainerConcept
620 void __constraints() {
621 __function_requires
< _ForwardContainerConcept
<_ForwardContainer
> >();
622 __function_requires
< _Mutable_ContainerConcept
<_ForwardContainer
> >();
623 typedef typename
_ForwardContainer::iterator _Iterator
;
624 __function_requires
< _Mutable_ForwardIteratorConcept
<_Iterator
> >();
628 template <class _ReversibleContainer
>
629 struct _ReversibleContainerConcept
631 typedef typename
_ReversibleContainer::const_iterator _Const_iterator
;
632 typedef typename
_ReversibleContainer::const_reverse_iterator
633 _Const_reverse_iterator
;
635 void __constraints() {
636 __function_requires
< _ForwardContainerConcept
<_ReversibleContainer
> >();
637 __function_requires
< _BidirectionalIteratorConcept
<_Const_iterator
> >();
639 _BidirectionalIteratorConcept
<_Const_reverse_iterator
> >();
641 const _ReversibleContainer __c
;
642 _Const_reverse_iterator __i
= __c
.rbegin();
647 template <class _ReversibleContainer
>
648 struct _Mutable_ReversibleContainerConcept
650 typedef typename
_ReversibleContainer::iterator _Iterator
;
651 typedef typename
_ReversibleContainer::reverse_iterator _Reverse_iterator
;
653 void __constraints() {
654 __function_requires
<_ReversibleContainerConcept
<_ReversibleContainer
> >();
656 _Mutable_ForwardContainerConcept
<_ReversibleContainer
> >();
657 __function_requires
<_Mutable_BidirectionalIteratorConcept
<_Iterator
> >();
659 _Mutable_BidirectionalIteratorConcept
<_Reverse_iterator
> >();
661 _Reverse_iterator __i
= __c
.rbegin();
664 _ReversibleContainer __c
;
667 template <class _RandomAccessContainer
>
668 struct _RandomAccessContainerConcept
670 typedef typename
_RandomAccessContainer::size_type _Size_type
;
671 typedef typename
_RandomAccessContainer::const_reference _Const_reference
;
672 typedef typename
_RandomAccessContainer::const_iterator _Const_iterator
;
673 typedef typename
_RandomAccessContainer::const_reverse_iterator
674 _Const_reverse_iterator
;
676 void __constraints() {
678 _ReversibleContainerConcept
<_RandomAccessContainer
> >();
679 __function_requires
< _RandomAccessIteratorConcept
<_Const_iterator
> >();
681 _RandomAccessIteratorConcept
<_Const_reverse_iterator
> >();
683 const _RandomAccessContainer __c
;
684 _Const_reference __r _IsUnused
= __c
[__n
];
689 template <class _RandomAccessContainer
>
690 struct _Mutable_RandomAccessContainerConcept
692 typedef typename
_RandomAccessContainer::size_type _Size_type
;
693 typedef typename
_RandomAccessContainer::reference _Reference
;
694 typedef typename
_RandomAccessContainer::iterator _Iterator
;
695 typedef typename
_RandomAccessContainer::reverse_iterator _Reverse_iterator
;
697 void __constraints() {
699 _RandomAccessContainerConcept
<_RandomAccessContainer
> >();
701 _Mutable_ReversibleContainerConcept
<_RandomAccessContainer
> >();
702 __function_requires
< _Mutable_RandomAccessIteratorConcept
<_Iterator
> >();
704 _Mutable_RandomAccessIteratorConcept
<_Reverse_iterator
> >();
706 _Reference __r _IsUnused
= __c
[__i
];
709 _RandomAccessContainer __c
;
712 // A Sequence is inherently mutable
713 template <class _Sequence
>
714 struct _SequenceConcept
716 typedef typename
_Sequence::reference _Reference
;
717 typedef typename
_Sequence::const_reference _Const_reference
;
719 void __constraints() {
720 // Matt Austern's book puts DefaultConstructible here, the C++
721 // standard places it in Container
722 // function_requires< DefaultConstructible<Sequence> >();
723 __function_requires
< _Mutable_ForwardContainerConcept
<_Sequence
> >();
724 __function_requires
< _DefaultConstructibleConcept
<_Sequence
> >();
727 __c
_IsUnused(__n
, __t
),
728 __c2
_IsUnused(__first
, __last
);
730 __c
.insert(__p
, __t
);
731 __c
.insert(__p
, __n
, __t
);
732 __c
.insert(__p
, __first
, __last
);
737 _Reference __r _IsUnused
= __c
.front();
739 __const_constraints(__c
);
741 void __const_constraints(const _Sequence
& __c
) {
742 _Const_reference __r _IsUnused
= __c
.front();
744 typename
_Sequence::value_type __t
;
745 typename
_Sequence::size_type __n
;
746 typename
_Sequence::value_type
*__first
, *__last
;
747 typename
_Sequence::iterator __p
, __q
;
750 template <class _FrontInsertionSequence
>
751 struct _FrontInsertionSequenceConcept
753 void __constraints() {
754 __function_requires
< _SequenceConcept
<_FrontInsertionSequence
> >();
759 _FrontInsertionSequence __c
;
760 typename
_FrontInsertionSequence::value_type __t
;
763 template <class _BackInsertionSequence
>
764 struct _BackInsertionSequenceConcept
766 typedef typename
_BackInsertionSequence::reference _Reference
;
767 typedef typename
_BackInsertionSequence::const_reference _Const_reference
;
769 void __constraints() {
770 __function_requires
< _SequenceConcept
<_BackInsertionSequence
> >();
774 _Reference __r _IsUnused
= __c
.back();
776 void __const_constraints(const _BackInsertionSequence
& __c
) {
777 _Const_reference __r _IsUnused
= __c
.back();
779 _BackInsertionSequence __c
;
780 typename
_BackInsertionSequence::value_type __t
;
783 _GLIBCXX_END_NAMESPACE_VERSION
788 #endif // _GLIBCXX_BOOST_CONCEPT_CHECK