3 // Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010
4 // Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
26 // (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
27 // sell and distribute this software is granted provided this
28 // copyright notice appears in all copies. This software is provided
29 // "as is" without express or implied warranty, and with no claim as
30 // to its suitability for any purpose.
33 /** @file bits/boost_concept_check.h
34 * This is an internal header file, included by other library headers.
35 * Do not attempt to use it directly. @headername{iterator}
38 // GCC Note: based on version 1.12.0 of the Boost library.
40 #ifndef _BOOST_CONCEPT_CHECK_H
41 #define _BOOST_CONCEPT_CHECK_H 1
43 #pragma GCC system_header
45 #include <bits/c++config.h>
46 #include <bits/stl_iterator_base_types.h> // for traits and tags
48 namespace __gnu_cxx
_GLIBCXX_VISIBILITY(default)
50 _GLIBCXX_BEGIN_NAMESPACE_VERSION
52 #define _IsUnused __attribute__ ((__unused__))
54 // When the C-C code is in use, we would like this function to do as little
55 // as possible at runtime, use as few resources as possible, and hopefully
56 // be elided out of existence... hmmm.
57 template <class _Concept
>
58 inline void __function_requires()
60 void (_Concept::*__x
)() _IsUnused
= &_Concept::__constraints
;
63 // No definition: if this is referenced, there's a problem with
64 // the instantiating type not being one of the required integer types.
65 // Unfortunately, this results in a link-time error, not a compile-time error.
66 void __error_type_must_be_an_integer_type();
67 void __error_type_must_be_an_unsigned_integer_type();
68 void __error_type_must_be_a_signed_integer_type();
70 // ??? Should the "concept_checking*" structs begin with more than _ ?
71 #define _GLIBCXX_CLASS_REQUIRES(_type_var, _ns, _concept) \
72 typedef void (_ns::_concept <_type_var>::* _func##_type_var##_concept)(); \
73 template <_func##_type_var##_concept _Tp1> \
74 struct _concept_checking##_type_var##_concept { }; \
75 typedef _concept_checking##_type_var##_concept< \
76 &_ns::_concept <_type_var>::__constraints> \
77 _concept_checking_typedef##_type_var##_concept
79 #define _GLIBCXX_CLASS_REQUIRES2(_type_var1, _type_var2, _ns, _concept) \
80 typedef void (_ns::_concept <_type_var1,_type_var2>::* _func##_type_var1##_type_var2##_concept)(); \
81 template <_func##_type_var1##_type_var2##_concept _Tp1> \
82 struct _concept_checking##_type_var1##_type_var2##_concept { }; \
83 typedef _concept_checking##_type_var1##_type_var2##_concept< \
84 &_ns::_concept <_type_var1,_type_var2>::__constraints> \
85 _concept_checking_typedef##_type_var1##_type_var2##_concept
87 #define _GLIBCXX_CLASS_REQUIRES3(_type_var1, _type_var2, _type_var3, _ns, _concept) \
88 typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3>::* _func##_type_var1##_type_var2##_type_var3##_concept)(); \
89 template <_func##_type_var1##_type_var2##_type_var3##_concept _Tp1> \
90 struct _concept_checking##_type_var1##_type_var2##_type_var3##_concept { }; \
91 typedef _concept_checking##_type_var1##_type_var2##_type_var3##_concept< \
92 &_ns::_concept <_type_var1,_type_var2,_type_var3>::__constraints> \
93 _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_concept
95 #define _GLIBCXX_CLASS_REQUIRES4(_type_var1, _type_var2, _type_var3, _type_var4, _ns, _concept) \
96 typedef void (_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::* _func##_type_var1##_type_var2##_type_var3##_type_var4##_concept)(); \
97 template <_func##_type_var1##_type_var2##_type_var3##_type_var4##_concept _Tp1> \
98 struct _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept { }; \
99 typedef _concept_checking##_type_var1##_type_var2##_type_var3##_type_var4##_concept< \
100 &_ns::_concept <_type_var1,_type_var2,_type_var3,_type_var4>::__constraints> \
101 _concept_checking_typedef##_type_var1##_type_var2##_type_var3##_type_var4##_concept
104 template <class _Tp1
, class _Tp2
>
105 struct _Aux_require_same
{ };
108 struct _Aux_require_same
<_Tp
,_Tp
> { typedef _Tp _Type
; };
110 template <class _Tp1
, class _Tp2
>
111 struct _SameTypeConcept
113 void __constraints() {
114 typedef typename _Aux_require_same
<_Tp1
, _Tp2
>::_Type _Required
;
119 struct _IntegerConcept
{
120 void __constraints() {
121 __error_type_must_be_an_integer_type();
124 template <> struct _IntegerConcept
<short> { void __constraints() {} };
125 template <> struct _IntegerConcept
<unsigned short> { void __constraints(){} };
126 template <> struct _IntegerConcept
<int> { void __constraints() {} };
127 template <> struct _IntegerConcept
<unsigned int> { void __constraints() {} };
128 template <> struct _IntegerConcept
<long> { void __constraints() {} };
129 template <> struct _IntegerConcept
<unsigned long> { void __constraints() {} };
130 template <> struct _IntegerConcept
<long long> { void __constraints() {} };
131 template <> struct _IntegerConcept
<unsigned long long>
132 { void __constraints() {} };
135 struct _SignedIntegerConcept
{
136 void __constraints() {
137 __error_type_must_be_a_signed_integer_type();
140 template <> struct _SignedIntegerConcept
<short> { void __constraints() {} };
141 template <> struct _SignedIntegerConcept
<int> { void __constraints() {} };
142 template <> struct _SignedIntegerConcept
<long> { void __constraints() {} };
143 template <> struct _SignedIntegerConcept
<long long> { void __constraints(){}};
146 struct _UnsignedIntegerConcept
{
147 void __constraints() {
148 __error_type_must_be_an_unsigned_integer_type();
151 template <> struct _UnsignedIntegerConcept
<unsigned short>
152 { void __constraints() {} };
153 template <> struct _UnsignedIntegerConcept
<unsigned int>
154 { void __constraints() {} };
155 template <> struct _UnsignedIntegerConcept
<unsigned long>
156 { void __constraints() {} };
157 template <> struct _UnsignedIntegerConcept
<unsigned long long>
158 { void __constraints() {} };
160 //===========================================================================
164 struct _DefaultConstructibleConcept
166 void __constraints() {
167 _Tp __a _IsUnused
; // require default constructor
172 struct _AssignableConcept
174 void __constraints() {
175 __a
= __a
; // require assignment operator
176 __const_constraints(__a
);
178 void __const_constraints(const _Tp
& __b
) {
179 __a
= __b
; // const required for argument to assignment
182 // possibly should be "Tp* a;" and then dereference "a" in constraint
183 // functions? present way would require a default ctor, i think...
187 struct _CopyConstructibleConcept
189 void __constraints() {
190 _Tp
__a(__b
); // require copy constructor
191 _Tp
* __ptr _IsUnused
= &__a
; // require address of operator
192 __const_constraints(__a
);
194 void __const_constraints(const _Tp
& __a
) {
195 _Tp __c
_IsUnused(__a
); // require const copy constructor
196 const _Tp
* __ptr _IsUnused
= &__a
; // require const address of operator
201 // The SGI STL version of Assignable requires copy constructor and operator=
203 struct _SGIAssignableConcept
205 void __constraints() {
206 _Tp __b
_IsUnused(__a
);
207 __a
= __a
; // require assignment operator
208 __const_constraints(__a
);
210 void __const_constraints(const _Tp
& __b
) {
211 _Tp __c
_IsUnused(__b
);
212 __a
= __b
; // const required for argument to assignment
217 template <class _From
, class _To
>
218 struct _ConvertibleConcept
220 void __constraints() {
221 _To __y _IsUnused
= __x
;
226 // The C++ standard requirements for many concepts talk about return
227 // types that must be "convertible to bool". The problem with this
228 // requirement is that it leaves the door open for evil proxies that
229 // define things like operator|| with strange return types. Two
230 // possible solutions are:
231 // 1) require the return type to be exactly bool
232 // 2) stay with convertible to bool, and also
233 // specify stuff about all the logical operators.
234 // For now we just test for convertible to bool.
236 void __aux_require_boolean_expr(const _Tp
& __t
) {
237 bool __x _IsUnused
= __t
;
242 struct _EqualityComparableConcept
244 void __constraints() {
245 __aux_require_boolean_expr(__a
== __b
);
251 struct _LessThanComparableConcept
253 void __constraints() {
254 __aux_require_boolean_expr(__a
< __b
);
259 // This is equivalent to SGI STL's LessThanComparable.
261 struct _ComparableConcept
263 void __constraints() {
264 __aux_require_boolean_expr(__a
< __b
);
265 __aux_require_boolean_expr(__a
> __b
);
266 __aux_require_boolean_expr(__a
<= __b
);
267 __aux_require_boolean_expr(__a
>= __b
);
272 #define _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(_OP,_NAME) \
273 template <class _First, class _Second> \
275 void __constraints() { (void)__constraints_(); } \
276 bool __constraints_() { \
277 return __a _OP __b; \
283 #define _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(_OP,_NAME) \
284 template <class _Ret, class _First, class _Second> \
286 void __constraints() { (void)__constraints_(); } \
287 _Ret __constraints_() { \
288 return __a _OP __b; \
294 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(==, _EqualOpConcept
);
295 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(!=, _NotEqualOpConcept
);
296 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<, _LessThanOpConcept
);
297 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<=, _LessEqualOpConcept
);
298 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>, _GreaterThanOpConcept
);
299 _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>=, _GreaterEqualOpConcept
);
301 _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(+, _PlusOpConcept
);
302 _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(*, _TimesOpConcept
);
303 _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(/, _DivideOpConcept
);
304 _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, _SubtractOpConcept
);
305 _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, _ModOpConcept
);
307 #undef _GLIBCXX_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT
308 #undef _GLIBCXX_DEFINE_BINARY_OPERATOR_CONSTRAINT
310 //===========================================================================
311 // Function Object Concepts
313 template <class _Func
, class _Return
>
314 struct _GeneratorConcept
316 void __constraints() {
317 const _Return
& __r _IsUnused
= __f();// require operator() member function
323 template <class _Func
>
324 struct _GeneratorConcept
<_Func
,void>
326 void __constraints() {
327 __f(); // require operator() member function
332 template <class _Func
, class _Return
, class _Arg
>
333 struct _UnaryFunctionConcept
335 void __constraints() {
336 __r
= __f(__arg
); // require operator()
343 template <class _Func
, class _Arg
>
344 struct _UnaryFunctionConcept
<_Func
, void, _Arg
> {
345 void __constraints() {
346 __f(__arg
); // require operator()
352 template <class _Func
, class _Return
, class _First
, class _Second
>
353 struct _BinaryFunctionConcept
355 void __constraints() {
356 __r
= __f(__first
, __second
); // require operator()
364 template <class _Func
, class _First
, class _Second
>
365 struct _BinaryFunctionConcept
<_Func
, void, _First
, _Second
>
367 void __constraints() {
368 __f(__first
, __second
); // require operator()
375 template <class _Func
, class _Arg
>
376 struct _UnaryPredicateConcept
378 void __constraints() {
379 __aux_require_boolean_expr(__f(__arg
)); // require op() returning bool
385 template <class _Func
, class _First
, class _Second
>
386 struct _BinaryPredicateConcept
388 void __constraints() {
389 __aux_require_boolean_expr(__f(__a
, __b
)); // require op() returning bool
396 // use this when functor is used inside a container class like std::set
397 template <class _Func
, class _First
, class _Second
>
398 struct _Const_BinaryPredicateConcept
{
399 void __constraints() {
400 __const_constraints(__f
);
402 void __const_constraints(const _Func
& __fun
) {
403 __function_requires
<_BinaryPredicateConcept
<_Func
, _First
, _Second
> >();
404 // operator() must be a const member function
405 __aux_require_boolean_expr(__fun(__a
, __b
));
412 //===========================================================================
416 struct _TrivialIteratorConcept
418 void __constraints() {
419 // __function_requires< _DefaultConstructibleConcept<_Tp> >();
420 __function_requires
< _AssignableConcept
<_Tp
> >();
421 __function_requires
< _EqualityComparableConcept
<_Tp
> >();
422 // typedef typename std::iterator_traits<_Tp>::value_type _V;
423 (void)*__i
; // require dereference operator
429 struct _Mutable_TrivialIteratorConcept
431 void __constraints() {
432 __function_requires
< _TrivialIteratorConcept
<_Tp
> >();
433 *__i
= *__j
; // require dereference and assignment
439 struct _InputIteratorConcept
441 void __constraints() {
442 __function_requires
< _TrivialIteratorConcept
<_Tp
> >();
443 // require iterator_traits typedef's
444 typedef typename
std::iterator_traits
<_Tp
>::difference_type _Diff
;
445 // __function_requires< _SignedIntegerConcept<_Diff> >();
446 typedef typename
std::iterator_traits
<_Tp
>::reference _Ref
;
447 typedef typename
std::iterator_traits
<_Tp
>::pointer _Pt
;
448 typedef typename
std::iterator_traits
<_Tp
>::iterator_category _Cat
;
449 __function_requires
< _ConvertibleConcept
<
450 typename
std::iterator_traits
<_Tp
>::iterator_category
,
451 std::input_iterator_tag
> >();
452 ++__i
; // require preincrement operator
453 __i
++; // require postincrement operator
458 template <class _Tp
, class _ValueT
>
459 struct _OutputIteratorConcept
461 void __constraints() {
462 __function_requires
< _AssignableConcept
<_Tp
> >();
463 ++__i
; // require preincrement operator
464 __i
++; // require postincrement operator
465 *__i
++ = __t
; // require postincrement and assignment
472 struct _ForwardIteratorConcept
474 void __constraints() {
475 __function_requires
< _InputIteratorConcept
<_Tp
> >();
476 __function_requires
< _DefaultConstructibleConcept
<_Tp
> >();
477 __function_requires
< _ConvertibleConcept
<
478 typename
std::iterator_traits
<_Tp
>::iterator_category
,
479 std::forward_iterator_tag
> >();
480 typedef typename
std::iterator_traits
<_Tp
>::reference _Ref
;
481 _Ref __r _IsUnused
= *__i
;
487 struct _Mutable_ForwardIteratorConcept
489 void __constraints() {
490 __function_requires
< _ForwardIteratorConcept
<_Tp
> >();
491 *__i
++ = *__i
; // require postincrement and assignment
497 struct _BidirectionalIteratorConcept
499 void __constraints() {
500 __function_requires
< _ForwardIteratorConcept
<_Tp
> >();
501 __function_requires
< _ConvertibleConcept
<
502 typename
std::iterator_traits
<_Tp
>::iterator_category
,
503 std::bidirectional_iterator_tag
> >();
504 --__i
; // require predecrement operator
505 __i
--; // require postdecrement operator
511 struct _Mutable_BidirectionalIteratorConcept
513 void __constraints() {
514 __function_requires
< _BidirectionalIteratorConcept
<_Tp
> >();
515 __function_requires
< _Mutable_ForwardIteratorConcept
<_Tp
> >();
516 *__i
-- = *__i
; // require postdecrement and assignment
523 struct _RandomAccessIteratorConcept
525 void __constraints() {
526 __function_requires
< _BidirectionalIteratorConcept
<_Tp
> >();
527 __function_requires
< _ComparableConcept
<_Tp
> >();
528 __function_requires
< _ConvertibleConcept
<
529 typename
std::iterator_traits
<_Tp
>::iterator_category
,
530 std::random_access_iterator_tag
> >();
531 // ??? We don't use _Ref, are we just checking for "referenceability"?
532 typedef typename
std::iterator_traits
<_Tp
>::reference _Ref
;
534 __i
+= __n
; // require assignment addition operator
535 __i
= __i
+ __n
; __i
= __n
+ __i
; // require addition with difference type
536 __i
-= __n
; // require assignment subtraction op
537 __i
= __i
- __n
; // require subtraction with
539 __n
= __i
- __j
; // require difference operator
540 (void)__i
[__n
]; // require element access operator
544 typename
std::iterator_traits
<_Tp
>::difference_type __n
;
548 struct _Mutable_RandomAccessIteratorConcept
550 void __constraints() {
551 __function_requires
< _RandomAccessIteratorConcept
<_Tp
> >();
552 __function_requires
< _Mutable_BidirectionalIteratorConcept
<_Tp
> >();
553 __i
[__n
] = *__i
; // require element access and assignment
556 typename
std::iterator_traits
<_Tp
>::difference_type __n
;
559 //===========================================================================
560 // Container Concepts
562 template <class _Container
>
563 struct _ContainerConcept
565 typedef typename
_Container::value_type _Value_type
;
566 typedef typename
_Container::difference_type _Difference_type
;
567 typedef typename
_Container::size_type _Size_type
;
568 typedef typename
_Container::const_reference _Const_reference
;
569 typedef typename
_Container::const_pointer _Const_pointer
;
570 typedef typename
_Container::const_iterator _Const_iterator
;
572 void __constraints() {
573 __function_requires
< _InputIteratorConcept
<_Const_iterator
> >();
574 __function_requires
< _AssignableConcept
<_Container
> >();
575 const _Container __c
;
579 __n
= __c
.max_size();
587 template <class _Container
>
588 struct _Mutable_ContainerConcept
590 typedef typename
_Container::value_type _Value_type
;
591 typedef typename
_Container::reference _Reference
;
592 typedef typename
_Container::iterator _Iterator
;
593 typedef typename
_Container::pointer _Pointer
;
595 void __constraints() {
596 __function_requires
< _ContainerConcept
<_Container
> >();
597 __function_requires
< _AssignableConcept
<_Value_type
> >();
598 __function_requires
< _InputIteratorConcept
<_Iterator
> >();
605 _Container __c
, __c2
;
608 template <class _ForwardContainer
>
609 struct _ForwardContainerConcept
611 void __constraints() {
612 __function_requires
< _ContainerConcept
<_ForwardContainer
> >();
613 typedef typename
_ForwardContainer::const_iterator _Const_iterator
;
614 __function_requires
< _ForwardIteratorConcept
<_Const_iterator
> >();
618 template <class _ForwardContainer
>
619 struct _Mutable_ForwardContainerConcept
621 void __constraints() {
622 __function_requires
< _ForwardContainerConcept
<_ForwardContainer
> >();
623 __function_requires
< _Mutable_ContainerConcept
<_ForwardContainer
> >();
624 typedef typename
_ForwardContainer::iterator _Iterator
;
625 __function_requires
< _Mutable_ForwardIteratorConcept
<_Iterator
> >();
629 template <class _ReversibleContainer
>
630 struct _ReversibleContainerConcept
632 typedef typename
_ReversibleContainer::const_iterator _Const_iterator
;
633 typedef typename
_ReversibleContainer::const_reverse_iterator
634 _Const_reverse_iterator
;
636 void __constraints() {
637 __function_requires
< _ForwardContainerConcept
<_ReversibleContainer
> >();
638 __function_requires
< _BidirectionalIteratorConcept
<_Const_iterator
> >();
640 _BidirectionalIteratorConcept
<_Const_reverse_iterator
> >();
642 const _ReversibleContainer __c
;
643 _Const_reverse_iterator __i
= __c
.rbegin();
648 template <class _ReversibleContainer
>
649 struct _Mutable_ReversibleContainerConcept
651 typedef typename
_ReversibleContainer::iterator _Iterator
;
652 typedef typename
_ReversibleContainer::reverse_iterator _Reverse_iterator
;
654 void __constraints() {
655 __function_requires
<_ReversibleContainerConcept
<_ReversibleContainer
> >();
657 _Mutable_ForwardContainerConcept
<_ReversibleContainer
> >();
658 __function_requires
<_Mutable_BidirectionalIteratorConcept
<_Iterator
> >();
660 _Mutable_BidirectionalIteratorConcept
<_Reverse_iterator
> >();
662 _Reverse_iterator __i
= __c
.rbegin();
665 _ReversibleContainer __c
;
668 template <class _RandomAccessContainer
>
669 struct _RandomAccessContainerConcept
671 typedef typename
_RandomAccessContainer::size_type _Size_type
;
672 typedef typename
_RandomAccessContainer::const_reference _Const_reference
;
673 typedef typename
_RandomAccessContainer::const_iterator _Const_iterator
;
674 typedef typename
_RandomAccessContainer::const_reverse_iterator
675 _Const_reverse_iterator
;
677 void __constraints() {
679 _ReversibleContainerConcept
<_RandomAccessContainer
> >();
680 __function_requires
< _RandomAccessIteratorConcept
<_Const_iterator
> >();
682 _RandomAccessIteratorConcept
<_Const_reverse_iterator
> >();
684 const _RandomAccessContainer __c
;
685 _Const_reference __r _IsUnused
= __c
[__n
];
690 template <class _RandomAccessContainer
>
691 struct _Mutable_RandomAccessContainerConcept
693 typedef typename
_RandomAccessContainer::size_type _Size_type
;
694 typedef typename
_RandomAccessContainer::reference _Reference
;
695 typedef typename
_RandomAccessContainer::iterator _Iterator
;
696 typedef typename
_RandomAccessContainer::reverse_iterator _Reverse_iterator
;
698 void __constraints() {
700 _RandomAccessContainerConcept
<_RandomAccessContainer
> >();
702 _Mutable_ReversibleContainerConcept
<_RandomAccessContainer
> >();
703 __function_requires
< _Mutable_RandomAccessIteratorConcept
<_Iterator
> >();
705 _Mutable_RandomAccessIteratorConcept
<_Reverse_iterator
> >();
707 _Reference __r _IsUnused
= __c
[__i
];
710 _RandomAccessContainer __c
;
713 // A Sequence is inherently mutable
714 template <class _Sequence
>
715 struct _SequenceConcept
717 typedef typename
_Sequence::reference _Reference
;
718 typedef typename
_Sequence::const_reference _Const_reference
;
720 void __constraints() {
721 // Matt Austern's book puts DefaultConstructible here, the C++
722 // standard places it in Container
723 // function_requires< DefaultConstructible<Sequence> >();
724 __function_requires
< _Mutable_ForwardContainerConcept
<_Sequence
> >();
725 __function_requires
< _DefaultConstructibleConcept
<_Sequence
> >();
728 __c
_IsUnused(__n
, __t
),
729 __c2
_IsUnused(__first
, __last
);
731 __c
.insert(__p
, __t
);
732 __c
.insert(__p
, __n
, __t
);
733 __c
.insert(__p
, __first
, __last
);
738 _Reference __r _IsUnused
= __c
.front();
740 __const_constraints(__c
);
742 void __const_constraints(const _Sequence
& __c
) {
743 _Const_reference __r _IsUnused
= __c
.front();
745 typename
_Sequence::value_type __t
;
746 typename
_Sequence::size_type __n
;
747 typename
_Sequence::value_type
*__first
, *__last
;
748 typename
_Sequence::iterator __p
, __q
;
751 template <class _FrontInsertionSequence
>
752 struct _FrontInsertionSequenceConcept
754 void __constraints() {
755 __function_requires
< _SequenceConcept
<_FrontInsertionSequence
> >();
760 _FrontInsertionSequence __c
;
761 typename
_FrontInsertionSequence::value_type __t
;
764 template <class _BackInsertionSequence
>
765 struct _BackInsertionSequenceConcept
767 typedef typename
_BackInsertionSequence::reference _Reference
;
768 typedef typename
_BackInsertionSequence::const_reference _Const_reference
;
770 void __constraints() {
771 __function_requires
< _SequenceConcept
<_BackInsertionSequence
> >();
775 _Reference __r _IsUnused
= __c
.back();
777 void __const_constraints(const _BackInsertionSequence
& __c
) {
778 _Const_reference __r _IsUnused
= __c
.back();
780 _BackInsertionSequence __c
;
781 typename
_BackInsertionSequence::value_type __t
;
784 _GLIBCXX_END_NAMESPACE_VERSION
789 #endif // _GLIBCXX_BOOST_CONCEPT_CHECK