56 #ifndef _STL_ALGOBASE_H
57 #define _STL_ALGOBASE_H 1
72 #if __cplusplus >= 201103L
75 #if __cplusplus > 201703L
79 namespace std _GLIBCXX_VISIBILITY(default)
81 _GLIBCXX_BEGIN_NAMESPACE_VERSION
87 template<
bool _IsMove,
typename _Tp>
90 __memmove(_Tp* __dst,
const _Tp* __src,
size_t __num)
92 #ifdef __cpp_lib_is_constant_evaluated
93 if (std::is_constant_evaluated())
95 for(; __num > 0; --__num)
97 if constexpr (_IsMove)
108 return __builtin_memmove(__dst, __src,
sizeof(_Tp) * __num);
116 template<
typename _Tp>
119 __memcmp(
const _Tp* __first1,
const _Tp* __first2,
size_t __num)
121 #ifdef __cpp_lib_is_constant_evaluated
122 if (std::is_constant_evaluated())
124 for(; __num > 0; ++__first1, ++__first2, --__num)
125 if (*__first1 != *__first2)
126 return *__first1 < *__first2 ? -1 : 1;
131 return __builtin_memcmp(__first1, __first2,
sizeof(_Tp) * __num);
134 #if __cplusplus < 201103L
138 template<
bool _BoolType>
141 template<
typename _ForwardIterator1,
typename _ForwardIterator2>
144 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
146 typedef typename iterator_traits<_ForwardIterator1>::value_type
148 _ValueType1 __tmp = *__a;
155 struct __iter_swap<true>
157 template<
typename _ForwardIterator1,
typename _ForwardIterator2>
160 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
177 template<
typename _ForwardIterator1,
typename _ForwardIterator2>
180 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
183 __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
185 __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
188 #if __cplusplus < 201103L
194 __glibcxx_function_requires(_ConvertibleConcept<_ValueType1,
196 __glibcxx_function_requires(_ConvertibleConcept<_ValueType2,
203 std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value
204 && __are_same<_ValueType1&, _ReferenceType1>::__value
205 && __are_same<_ValueType2&, _ReferenceType2>::__value>::
224 template<
typename _ForwardIterator1,
typename _ForwardIterator2>
227 swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
228 _ForwardIterator2 __first2)
231 __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
233 __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
235 __glibcxx_requires_valid_range(__first1, __last1);
237 for (; __first1 != __last1; ++__first1, (void)++__first2)
253 template<
typename _Tp>
256 min(
const _Tp& __a,
const _Tp& __b)
259 __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
277 template<
typename _Tp>
280 max(
const _Tp& __a,
const _Tp& __b)
283 __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
301 template<
typename _Tp,
typename _Compare>
304 min(
const _Tp& __a,
const _Tp& __b, _Compare __comp)
307 if (__comp(__b, __a))
323 template<
typename _Tp,
typename _Compare>
326 max(
const _Tp& __a,
const _Tp& __b, _Compare __comp)
329 if (__comp(__a, __b))
336 template<
typename _Iterator>
339 __niter_base(_Iterator __it)
346 template<
typename _From,
typename _To>
349 __niter_wrap(_From __from, _To __res)
350 {
return __from + (__res - std::__niter_base(__from)); }
353 template<
typename _Iterator>
356 __niter_wrap(
const _Iterator&, _Iterator __res)
365 template<
bool _IsMove,
bool _IsSimple,
typename _Category>
368 template<
typename _II,
typename _OI>
371 __copy_m(_II __first, _II __last, _OI __result)
373 for (; __first != __last; ++__result, (void)++__first)
374 *__result = *__first;
379 #if __cplusplus >= 201103L
380 template<
typename _Category>
381 struct __copy_move<true, false, _Category>
383 template<
typename _II,
typename _OI>
386 __copy_m(_II __first, _II __last, _OI __result)
388 for (; __first != __last; ++__result, (void)++__first)
396 struct __copy_move<false, false, random_access_iterator_tag>
398 template<
typename _II,
typename _OI>
401 __copy_m(_II __first, _II __last, _OI __result)
403 typedef typename iterator_traits<_II>::difference_type _Distance;
404 for(_Distance __n = __last - __first; __n > 0; --__n)
406 *__result = *__first;
414 #if __cplusplus >= 201103L
416 struct __copy_move<true, false, random_access_iterator_tag>
418 template<
typename _II,
typename _OI>
421 __copy_m(_II __first, _II __last, _OI __result)
423 typedef typename iterator_traits<_II>::difference_type _Distance;
424 for(_Distance __n = __last - __first; __n > 0; --__n)
435 template<
bool _IsMove>
436 struct __copy_move<_IsMove, true, random_access_iterator_tag>
438 template<
typename _Tp>
441 __copy_m(
const _Tp* __first,
const _Tp* __last, _Tp* __result)
443 #if __cplusplus >= 201103L
444 using __assignable = conditional<_IsMove,
445 is_move_assignable<_Tp>,
446 is_copy_assignable<_Tp>>;
448 static_assert( __assignable::type::value,
"type is not assignable" );
450 const ptrdiff_t _Num = __last - __first;
452 std::__memmove<_IsMove>(__result, __first, _Num);
453 return __result + _Num;
459 template<
typename _CharT>
462 template<
typename _CharT,
typename _Traits>
463 class istreambuf_iterator;
465 template<
typename _CharT,
typename _Traits>
466 class ostreambuf_iterator;
468 template<
bool _IsMove,
typename _CharT>
469 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
470 ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
471 __copy_move_a2(_CharT*, _CharT*,
472 ostreambuf_iterator<_CharT, char_traits<_CharT> >);
474 template<
bool _IsMove,
typename _CharT>
475 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
476 ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
477 __copy_move_a2(
const _CharT*,
const _CharT*,
478 ostreambuf_iterator<_CharT, char_traits<_CharT> >);
480 template<
bool _IsMove,
typename _CharT>
481 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
483 __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
484 istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
486 template<
bool _IsMove,
typename _II,
typename _OI>
489 __copy_move_a2(_II __first, _II __last, _OI __result)
491 typedef typename iterator_traits<_II>::value_type _ValueTypeI;
492 typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
493 typedef typename iterator_traits<_II>::iterator_category _Category;
494 const bool __simple = (__is_trivially_copyable(_ValueTypeI)
495 && __is_pointer<_II>::__value
496 && __is_pointer<_OI>::__value
497 && __are_same<_ValueTypeI, _ValueTypeO>::__value);
498 return std::__copy_move<_IsMove, __simple,
499 _Category>::__copy_m(__first, __last, __result);
502 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
504 template<
typename _Tp,
typename _Ref,
typename _Ptr>
507 _GLIBCXX_END_NAMESPACE_CONTAINER
509 template<
bool _IsMove,
510 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
512 __copy_move_a1(_GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
513 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
516 template<
bool _IsMove,
517 typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp>
518 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
519 __copy_move_a1(_GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr>,
520 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr>,
521 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>);
523 template<
bool _IsMove,
typename _II,
typename _Tp>
524 typename __gnu_cxx::__enable_if<
525 __is_random_access_iter<_II>::__value,
526 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> >::__type
527 __copy_move_a1(_II, _II, _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>);
529 template<
bool _IsMove,
typename _II,
typename _OI>
532 __copy_move_a1(_II __first, _II __last, _OI __result)
533 {
return std::__copy_move_a2<_IsMove>(__first, __last, __result); }
535 template<
bool _IsMove,
typename _II,
typename _OI>
538 __copy_move_a(_II __first, _II __last, _OI __result)
540 return std::__niter_wrap(__result,
541 std::__copy_move_a1<_IsMove>(std::__niter_base(__first),
542 std::__niter_base(__last),
543 std::__niter_base(__result)));
546 template<
bool _IsMove,
547 typename _Ite,
typename _Seq,
typename _Cat,
typename _OI>
549 __copy_move_a(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
550 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
553 template<
bool _IsMove,
554 typename _II,
typename _Ite,
typename _Seq,
typename _Cat>
556 __copy_move_a(_II, _II,
557 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&);
559 template<
bool _IsMove,
560 typename _IIte,
typename _ISeq,
typename _ICat,
561 typename _OIte,
typename _OSeq,
typename _OCat>
563 __copy_move_a(const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&,
564 const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&,
565 const ::__gnu_debug::_Safe_iterator<_OIte, _OSeq, _OCat>&);
584 template<
typename _II,
typename _OI>
587 copy(_II __first, _II __last, _OI __result)
590 __glibcxx_function_requires(_InputIteratorConcept<_II>)
591 __glibcxx_function_requires(_OutputIteratorConcept<_OI,
593 __glibcxx_requires_can_increment_range(__first, __last, __result);
595 return std::__copy_move_a<__is_move_iterator<_II>::__value>
596 (std::__miter_base(__first), std::__miter_base(__last), __result);
599 #if __cplusplus >= 201103L
617 template<
typename _II,
typename _OI>
620 move(_II __first, _II __last, _OI __result)
623 __glibcxx_function_requires(_InputIteratorConcept<_II>)
624 __glibcxx_function_requires(_OutputIteratorConcept<_OI,
626 __glibcxx_requires_can_increment_range(__first, __last, __result);
628 return std::__copy_move_a<true>(std::__miter_base(__first),
629 std::__miter_base(__last), __result);
632 #define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::move(_Tp, _Up, _Vp)
634 #define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::copy(_Tp, _Up, _Vp)
637 template<
bool _IsMove,
bool _IsSimple,
typename _Category>
638 struct __copy_move_backward
640 template<
typename _BI1,
typename _BI2>
643 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
645 while (__first != __last)
646 *--__result = *--__last;
651 #if __cplusplus >= 201103L
652 template<
typename _Category>
653 struct __copy_move_backward<true, false, _Category>
655 template<
typename _BI1,
typename _BI2>
658 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
660 while (__first != __last)
668 struct __copy_move_backward<false, false, random_access_iterator_tag>
670 template<
typename _BI1,
typename _BI2>
673 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
675 typename iterator_traits<_BI1>::difference_type
676 __n = __last - __first;
677 for (; __n > 0; --__n)
678 *--__result = *--__last;
683 #if __cplusplus >= 201103L
685 struct __copy_move_backward<true, false, random_access_iterator_tag>
687 template<
typename _BI1,
typename _BI2>
690 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
692 typename iterator_traits<_BI1>::difference_type
693 __n = __last - __first;
694 for (; __n > 0; --__n)
701 template<
bool _IsMove>
702 struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
704 template<
typename _Tp>
707 __copy_move_b(
const _Tp* __first,
const _Tp* __last, _Tp* __result)
709 #if __cplusplus >= 201103L
710 using __assignable = conditional<_IsMove,
711 is_move_assignable<_Tp>,
712 is_copy_assignable<_Tp>>;
714 static_assert( __assignable::type::value,
"type is not assignable" );
716 const ptrdiff_t _Num = __last - __first;
718 std::__memmove<_IsMove>(__result - _Num, __first, _Num);
719 return __result - _Num;
723 template<
bool _IsMove,
typename _BI1,
typename _BI2>
726 __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
728 typedef typename iterator_traits<_BI1>::value_type _ValueType1;
729 typedef typename iterator_traits<_BI2>::value_type _ValueType2;
730 typedef typename iterator_traits<_BI1>::iterator_category _Category;
731 const bool __simple = (__is_trivially_copyable(_ValueType1)
732 && __is_pointer<_BI1>::__value
733 && __is_pointer<_BI2>::__value
734 && __are_same<_ValueType1, _ValueType2>::__value);
736 #ifdef __cpp_lib_is_constant_evaluated
737 if (std::is_constant_evaluated())
738 return std::__copy_move_backward<
true,
false,
739 _Category>::__copy_move_b(__first, __last,
742 return std::__copy_move_backward<_IsMove, __simple,
743 _Category>::__copy_move_b(__first,
748 template<
bool _IsMove,
typename _BI1,
typename _BI2>
751 __copy_move_backward_a1(_BI1 __first, _BI1 __last, _BI2 __result)
752 {
return std::__copy_move_backward_a2<_IsMove>(__first, __last, __result); }
754 template<
bool _IsMove,
755 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
757 __copy_move_backward_a1(_GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
758 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
761 template<
bool _IsMove,
762 typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp>
763 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
764 __copy_move_backward_a1(
765 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr>,
766 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr>,
767 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>);
769 template<
bool _IsMove,
typename _II,
typename _Tp>
770 typename __gnu_cxx::__enable_if<
771 __is_random_access_iter<_II>::__value,
772 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> >::__type
773 __copy_move_backward_a1(_II, _II,
774 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>);
776 template<
bool _IsMove,
typename _II,
typename _OI>
779 __copy_move_backward_a(_II __first, _II __last, _OI __result)
781 return std::__niter_wrap(__result,
782 std::__copy_move_backward_a1<_IsMove>
783 (std::__niter_base(__first), std::__niter_base(__last),
784 std::__niter_base(__result)));
787 template<
bool _IsMove,
788 typename _Ite,
typename _Seq,
typename _Cat,
typename _OI>
790 __copy_move_backward_a(
791 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
792 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
795 template<
bool _IsMove,
796 typename _II,
typename _Ite,
typename _Seq,
typename _Cat>
798 __copy_move_backward_a(_II, _II,
799 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&);
801 template<
bool _IsMove,
802 typename _IIte,
typename _ISeq,
typename _ICat,
803 typename _OIte,
typename _OSeq,
typename _OCat>
805 __copy_move_backward_a(
806 const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&,
807 const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&,
808 const ::__gnu_debug::_Safe_iterator<_OIte, _OSeq, _OCat>&);
828 template<
typename _BI1,
typename _BI2>
831 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
834 __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>)
835 __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>)
836 __glibcxx_function_requires(_ConvertibleConcept<
839 __glibcxx_requires_can_decrement_range(__first, __last, __result);
841 return std::__copy_move_backward_a<__is_move_iterator<_BI1>::__value>
842 (std::__miter_base(__first), std::__miter_base(__last), __result);
845 #if __cplusplus >= 201103L
864 template<
typename _BI1,
typename _BI2>
870 __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>)
871 __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>)
872 __glibcxx_function_requires(_ConvertibleConcept<
875 __glibcxx_requires_can_decrement_range(__first, __last, __result);
877 return std::__copy_move_backward_a<true>(std::__miter_base(__first),
878 std::__miter_base(__last),
882 #define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::move_backward(_Tp, _Up, _Vp)
884 #define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::copy_backward(_Tp, _Up, _Vp)
887 template<
typename _ForwardIterator,
typename _Tp>
890 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value,
void>::__type
891 __fill_a1(_ForwardIterator __first, _ForwardIterator __last,
894 for (; __first != __last; ++__first)
898 template<
typename _ForwardIterator,
typename _Tp>
901 __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value,
void>::__type
902 __fill_a1(_ForwardIterator __first, _ForwardIterator __last,
905 const _Tp __tmp = __value;
906 for (; __first != __last; ++__first)
911 template<
typename _Tp>
913 __gnu_cxx::__enable_if<__is_byte<_Tp>::__value,
void>::__type
914 __fill_a1(_Tp* __first, _Tp* __last,
const _Tp& __c)
916 const _Tp __tmp = __c;
917 if (
const size_t __len = __last - __first)
918 __builtin_memset(__first,
static_cast<unsigned char>(__tmp), __len);
921 template<
typename _Ite,
typename _Cont,
typename _Tp>
924 __fill_a1(::__gnu_cxx::__normal_iterator<_Ite, _Cont> __first,
925 ::__gnu_cxx::__normal_iterator<_Ite, _Cont> __last,
927 { std::__fill_a1(__first.base(), __last.base(), __value); }
929 template<
typename _Tp,
typename _VTp>
931 __fill_a1(
const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>&,
932 const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>&,
935 template<
typename _FIte,
typename _Tp>
938 __fill_a(_FIte __first, _FIte __last,
const _Tp& __value)
939 { std::__fill_a1(__first, __last, __value); }
941 template<
typename _Ite,
typename _Seq,
typename _Cat,
typename _Tp>
943 __fill_a(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
944 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
959 template<
typename _ForwardIterator,
typename _Tp>
962 fill(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __value)
965 __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
967 __glibcxx_requires_valid_range(__first, __last);
969 std::__fill_a(__first, __last, __value);
973 inline _GLIBCXX_CONSTEXPR
int
974 __size_to_integer(
int __n) {
return __n; }
975 inline _GLIBCXX_CONSTEXPR
unsigned
976 __size_to_integer(
unsigned __n) {
return __n; }
977 inline _GLIBCXX_CONSTEXPR
long
978 __size_to_integer(
long __n) {
return __n; }
979 inline _GLIBCXX_CONSTEXPR
unsigned long
980 __size_to_integer(
unsigned long __n) {
return __n; }
981 inline _GLIBCXX_CONSTEXPR
long long
982 __size_to_integer(
long long __n) {
return __n; }
983 inline _GLIBCXX_CONSTEXPR
unsigned long long
984 __size_to_integer(
unsigned long long __n) {
return __n; }
986 #if defined(__GLIBCXX_TYPE_INT_N_0)
987 inline _GLIBCXX_CONSTEXPR __GLIBCXX_TYPE_INT_N_0
988 __size_to_integer(__GLIBCXX_TYPE_INT_N_0 __n) {
return __n; }
989 inline _GLIBCXX_CONSTEXPR
unsigned __GLIBCXX_TYPE_INT_N_0
990 __size_to_integer(
unsigned __GLIBCXX_TYPE_INT_N_0 __n) {
return __n; }
992 #if defined(__GLIBCXX_TYPE_INT_N_1)
993 inline _GLIBCXX_CONSTEXPR __GLIBCXX_TYPE_INT_N_1
994 __size_to_integer(__GLIBCXX_TYPE_INT_N_1 __n) {
return __n; }
995 inline _GLIBCXX_CONSTEXPR
unsigned __GLIBCXX_TYPE_INT_N_1
996 __size_to_integer(
unsigned __GLIBCXX_TYPE_INT_N_1 __n) {
return __n; }
998 #if defined(__GLIBCXX_TYPE_INT_N_2)
999 inline _GLIBCXX_CONSTEXPR __GLIBCXX_TYPE_INT_N_2
1000 __size_to_integer(__GLIBCXX_TYPE_INT_N_2 __n) {
return __n; }
1001 inline _GLIBCXX_CONSTEXPR
unsigned __GLIBCXX_TYPE_INT_N_2
1002 __size_to_integer(
unsigned __GLIBCXX_TYPE_INT_N_2 __n) {
return __n; }
1004 #if defined(__GLIBCXX_TYPE_INT_N_3)
1005 inline _GLIBCXX_CONSTEXPR
unsigned __GLIBCXX_TYPE_INT_N_3
1006 __size_to_integer(__GLIBCXX_TYPE_INT_N_3 __n) {
return __n; }
1007 inline _GLIBCXX_CONSTEXPR __GLIBCXX_TYPE_INT_N_3
1008 __size_to_integer(
unsigned __GLIBCXX_TYPE_INT_N_3 __n) {
return __n; }
1011 inline _GLIBCXX_CONSTEXPR
long long
1012 __size_to_integer(
float __n) {
return __n; }
1013 inline _GLIBCXX_CONSTEXPR
long long
1014 __size_to_integer(
double __n) {
return __n; }
1015 inline _GLIBCXX_CONSTEXPR
long long
1016 __size_to_integer(
long double __n) {
return __n; }
1017 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
1018 inline _GLIBCXX_CONSTEXPR
long long
1019 __size_to_integer(__float128 __n) {
return __n; }
1022 template<
typename _OutputIterator,
typename _Size,
typename _Tp>
1023 _GLIBCXX20_CONSTEXPR
1025 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
1026 __fill_n_a1(_OutputIterator __first, _Size __n,
const _Tp& __value)
1028 for (; __n > 0; --__n, (void) ++__first)
1033 template<
typename _OutputIterator,
typename _Size,
typename _Tp>
1034 _GLIBCXX20_CONSTEXPR
1036 __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
1037 __fill_n_a1(_OutputIterator __first, _Size __n,
const _Tp& __value)
1039 const _Tp __tmp = __value;
1040 for (; __n > 0; --__n, (void) ++__first)
1045 template<
typename _Ite,
typename _Seq,
typename _Cat,
typename _Size,
1048 __fill_n_a(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>& __first,
1049 _Size __n,
const _Tp& __value,
1052 template<
typename _OutputIterator,
typename _Size,
typename _Tp>
1053 _GLIBCXX20_CONSTEXPR
1054 inline _OutputIterator
1055 __fill_n_a(_OutputIterator __first, _Size __n,
const _Tp& __value,
1058 #if __cplusplus >= 201103L
1059 static_assert(is_integral<_Size>{},
"fill_n must pass integral size");
1061 return __fill_n_a1(__first, __n, __value);
1064 template<
typename _OutputIterator,
typename _Size,
typename _Tp>
1065 _GLIBCXX20_CONSTEXPR
1066 inline _OutputIterator
1067 __fill_n_a(_OutputIterator __first, _Size __n,
const _Tp& __value,
1070 #if __cplusplus >= 201103L
1071 static_assert(is_integral<_Size>{},
"fill_n must pass integral size");
1073 return __fill_n_a1(__first, __n, __value);
1076 template<
typename _OutputIterator,
typename _Size,
typename _Tp>
1077 _GLIBCXX20_CONSTEXPR
1078 inline _OutputIterator
1079 __fill_n_a(_OutputIterator __first, _Size __n,
const _Tp& __value,
1082 #if __cplusplus >= 201103L
1083 static_assert(is_integral<_Size>{},
"fill_n must pass integral size");
1088 __glibcxx_requires_can_increment(__first, __n);
1090 std::__fill_a(__first, __first + __n, __value);
1091 return __first + __n;
1111 template<
typename _OI,
typename _Size,
typename _Tp>
1112 _GLIBCXX20_CONSTEXPR
1114 fill_n(_OI __first, _Size __n,
const _Tp& __value)
1117 __glibcxx_function_requires(_OutputIteratorConcept<_OI, _Tp>)
1119 return std::__fill_n_a(__first, std::__size_to_integer(__n), __value,
1123 template<
bool _BoolType>
1126 template<
typename _II1,
typename _II2>
1127 _GLIBCXX20_CONSTEXPR
1129 equal(_II1 __first1, _II1 __last1, _II2 __first2)
1131 for (; __first1 != __last1; ++__first1, (void) ++__first2)
1132 if (!(*__first1 == *__first2))
1139 struct __equal<true>
1141 template<
typename _Tp>
1142 _GLIBCXX20_CONSTEXPR
1144 equal(
const _Tp* __first1,
const _Tp* __last1,
const _Tp* __first2)
1146 if (
const size_t __len = (__last1 - __first1))
1147 return !std::__memcmp(__first1, __first2, __len);
1152 template<
typename _Tp,
typename _Ref,
typename _Ptr,
typename _II>
1153 typename __gnu_cxx::__enable_if<
1154 __is_random_access_iter<_II>::__value,
bool>::__type
1155 __equal_aux1(_GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
1156 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
1159 template<
typename _Tp1,
typename _Ref1,
typename _Ptr1,
1160 typename _Tp2,
typename _Ref2,
typename _Ptr2>
1162 __equal_aux1(_GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1>,
1163 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1>,
1164 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2>);
1166 template<
typename _II,
typename _Tp,
typename _Ref,
typename _Ptr>
1167 typename __gnu_cxx::__enable_if<
1168 __is_random_access_iter<_II>::__value,
bool>::__type
1169 __equal_aux1(_II, _II,
1170 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>);
1172 template<
typename _II1,
typename _II2>
1173 _GLIBCXX20_CONSTEXPR
1175 __equal_aux1(_II1 __first1, _II1 __last1, _II2 __first2)
1177 typedef typename iterator_traits<_II1>::value_type _ValueType1;
1178 typedef typename iterator_traits<_II2>::value_type _ValueType2;
1179 const bool __simple = ((__is_integer<_ValueType1>::__value
1180 || __is_pointer<_ValueType1>::__value)
1181 && __is_pointer<_II1>::__value
1182 && __is_pointer<_II2>::__value
1183 && __are_same<_ValueType1, _ValueType2>::__value);
1188 template<
typename _II1,
typename _II2>
1189 _GLIBCXX20_CONSTEXPR
1191 __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
1193 return std::__equal_aux1(std::__niter_base(__first1),
1194 std::__niter_base(__last1),
1195 std::__niter_base(__first2));
1198 template<
typename _II1,
typename _Seq1,
typename _Cat1,
typename _II2>
1200 __equal_aux(const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&,
1201 const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&,
1204 template<
typename _II1,
typename _II2,
typename _Seq2,
typename _Cat2>
1206 __equal_aux(_II1, _II1,
1207 const ::__gnu_debug::_Safe_iterator<_II2, _Seq2, _Cat2>&);
1209 template<
typename _II1,
typename _Seq1,
typename _Cat1,
1210 typename _II2,
typename _Seq2,
typename _Cat2>
1212 __equal_aux(const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&,
1213 const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&,
1214 const ::__gnu_debug::_Safe_iterator<_II2, _Seq2, _Cat2>&);
1216 template<
typename,
typename>
1219 template<
typename _II1,
typename _II2>
1220 _GLIBCXX20_CONSTEXPR
1222 __newlast1(_II1, _II1 __last1, _II2, _II2)
1225 template<
typename _II>
1226 _GLIBCXX20_CONSTEXPR
1228 __cnd2(_II __first, _II __last)
1229 {
return __first != __last; }
1233 struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
1235 template<
typename _RAI1,
typename _RAI2>
1236 _GLIBCXX20_CONSTEXPR
1238 __newlast1(_RAI1 __first1, _RAI1 __last1,
1239 _RAI2 __first2, _RAI2 __last2)
1241 const typename iterator_traits<_RAI1>::difference_type
1242 __diff1 = __last1 - __first1;
1243 const typename iterator_traits<_RAI2>::difference_type
1244 __diff2 = __last2 - __first2;
1245 return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
1248 template<
typename _RAI>
1249 static _GLIBCXX20_CONSTEXPR
bool
1254 template<
typename _II1,
typename _II2,
typename _Compare>
1255 _GLIBCXX20_CONSTEXPR
1257 __lexicographical_compare_impl(_II1 __first1, _II1 __last1,
1258 _II2 __first2, _II2 __last2,
1261 typedef typename iterator_traits<_II1>::iterator_category _Category1;
1262 typedef typename iterator_traits<_II2>::iterator_category _Category2;
1263 typedef std::__lc_rai<_Category1, _Category2> __rai_type;
1265 __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
1266 for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
1267 ++__first1, (void)++__first2)
1269 if (__comp(__first1, __first2))
1271 if (__comp(__first2, __first1))
1274 return __first1 == __last1 && __first2 != __last2;
1277 template<
bool _BoolType>
1278 struct __lexicographical_compare
1280 template<
typename _II1,
typename _II2>
1281 _GLIBCXX20_CONSTEXPR
1282 static bool __lc(_II1, _II1, _II2, _II2);
1285 template<
bool _BoolType>
1286 template<
typename _II1,
typename _II2>
1287 _GLIBCXX20_CONSTEXPR
1289 __lexicographical_compare<_BoolType>::
1290 __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
1292 return std::__lexicographical_compare_impl(__first1, __last1,
1294 __gnu_cxx::__ops::__iter_less_iter());
1298 struct __lexicographical_compare<true>
1300 template<
typename _Tp,
typename _Up>
1301 _GLIBCXX20_CONSTEXPR
1303 __lc(
const _Tp* __first1,
const _Tp* __last1,
1304 const _Up* __first2,
const _Up* __last2)
1306 const size_t __len1 = __last1 - __first1;
1307 const size_t __len2 = __last2 - __first2;
1308 if (
const size_t __len =
std::min(__len1, __len2))
1309 if (
int __result = std::__memcmp(__first1, __first2, __len))
1310 return __result < 0;
1311 return __len1 < __len2;
1315 template<
typename _II1,
typename _II2>
1316 _GLIBCXX20_CONSTEXPR
1318 __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
1319 _II2 __first2, _II2 __last2)
1321 typedef typename iterator_traits<_II1>::value_type _ValueType1;
1322 typedef typename iterator_traits<_II2>::value_type _ValueType2;
1323 const bool __simple =
1324 (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
1325 && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
1326 && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
1327 && __is_pointer<_II1>::__value
1328 && __is_pointer<_II2>::__value);
1330 return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
1334 template<
typename _ForwardIterator,
typename _Tp,
typename _Compare>
1335 _GLIBCXX20_CONSTEXPR
1337 __lower_bound(_ForwardIterator __first, _ForwardIterator __last,
1338 const _Tp& __val, _Compare __comp)
1340 typedef typename iterator_traits<_ForwardIterator>::difference_type
1347 _DistanceType __half = __len >> 1;
1348 _ForwardIterator __middle = __first;
1350 if (__comp(__middle, __val))
1354 __len = __len - __half - 1;
1373 template<
typename _ForwardIterator,
typename _Tp>
1374 _GLIBCXX20_CONSTEXPR
1375 inline _ForwardIterator
1376 lower_bound(_ForwardIterator __first, _ForwardIterator __last,
1380 __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
1381 __glibcxx_function_requires(_LessThanOpConcept<
1383 __glibcxx_requires_partitioned_lower(__first, __last, __val);
1385 return std::__lower_bound(__first, __last, __val,
1386 __gnu_cxx::__ops::__iter_less_val());
1391 inline _GLIBCXX_CONSTEXPR
int
1393 {
return (
int)
sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
1395 inline _GLIBCXX_CONSTEXPR
unsigned
1397 {
return (
int)
sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
1399 inline _GLIBCXX_CONSTEXPR
long
1401 {
return (
int)
sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
1403 inline _GLIBCXX_CONSTEXPR
unsigned long
1404 __lg(
unsigned long __n)
1405 {
return (
int)
sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
1407 inline _GLIBCXX_CONSTEXPR
long long
1409 {
return (
int)
sizeof(
long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
1411 inline _GLIBCXX_CONSTEXPR
unsigned long long
1412 __lg(
unsigned long long __n)
1413 {
return (
int)
sizeof(
long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
1415 _GLIBCXX_BEGIN_NAMESPACE_ALGO
1429 template<
typename _II1,
typename _II2>
1430 _GLIBCXX20_CONSTEXPR
1432 equal(_II1 __first1, _II1 __last1, _II2 __first2)
1435 __glibcxx_function_requires(_InputIteratorConcept<_II1>)
1436 __glibcxx_function_requires(_InputIteratorConcept<_II2>)
1437 __glibcxx_function_requires(_EqualOpConcept<
1440 __glibcxx_requires_can_increment_range(__first1, __last1, __first2);
1442 return std::__equal_aux(__first1, __last1, __first2);
1460 template<
typename _IIter1,
typename _IIter2,
typename _BinaryPredicate>
1461 _GLIBCXX20_CONSTEXPR
1463 equal(_IIter1 __first1, _IIter1 __last1,
1464 _IIter2 __first2, _BinaryPredicate __binary_pred)
1467 __glibcxx_function_requires(_InputIteratorConcept<_IIter1>)
1468 __glibcxx_function_requires(_InputIteratorConcept<_IIter2>)
1469 __glibcxx_requires_valid_range(__first1, __last1);
1471 for (; __first1 != __last1; ++__first1, (void)++__first2)
1472 if (!
bool(__binary_pred(*__first1, *__first2)))
1477 #if __cplusplus >= 201103L
1479 template<
typename _II1,
typename _II2>
1480 _GLIBCXX20_CONSTEXPR
1482 __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
1484 using _RATag = random_access_iterator_tag;
1485 using _Cat1 =
typename iterator_traits<_II1>::iterator_category;
1486 using _Cat2 =
typename iterator_traits<_II2>::iterator_category;
1487 using _RAIters = __and_<is_same<_Cat1, _RATag>, is_same<_Cat2, _RATag>>;
1497 for (; __first1 != __last1 && __first2 != __last2;
1498 ++__first1, (void)++__first2)
1499 if (!(*__first1 == *__first2))
1501 return __first1 == __last1 && __first2 == __last2;
1505 template<
typename _II1,
typename _II2,
typename _BinaryPredicate>
1506 _GLIBCXX20_CONSTEXPR
1508 __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2,
1509 _BinaryPredicate __binary_pred)
1511 using _RATag = random_access_iterator_tag;
1512 using _Cat1 =
typename iterator_traits<_II1>::iterator_category;
1513 using _Cat2 =
typename iterator_traits<_II2>::iterator_category;
1514 using _RAIters = __and_<is_same<_Cat1, _RATag>, is_same<_Cat2, _RATag>>;
1525 for (; __first1 != __last1 && __first2 != __last2;
1526 ++__first1, (void)++__first2)
1527 if (!
bool(__binary_pred(*__first1, *__first2)))
1529 return __first1 == __last1 && __first2 == __last2;
1533 #if __cplusplus > 201103L
1535 #define __cpp_lib_robust_nonmodifying_seq_ops 201304
1550 template<
typename _II1,
typename _II2>
1551 _GLIBCXX20_CONSTEXPR
1553 equal(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
1556 __glibcxx_function_requires(_InputIteratorConcept<_II1>)
1557 __glibcxx_function_requires(_InputIteratorConcept<_II2>)
1558 __glibcxx_function_requires(_EqualOpConcept<
1561 __glibcxx_requires_valid_range(__first1, __last1);
1562 __glibcxx_requires_valid_range(__first2, __last2);
1564 return _GLIBCXX_STD_A::__equal4(__first1, __last1, __first2, __last2);
1583 template<
typename _IIter1,
typename _IIter2,
typename _BinaryPredicate>
1584 _GLIBCXX20_CONSTEXPR
1586 equal(_IIter1 __first1, _IIter1 __last1,
1587 _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
1590 __glibcxx_function_requires(_InputIteratorConcept<_IIter1>)
1591 __glibcxx_function_requires(_InputIteratorConcept<_IIter2>)
1592 __glibcxx_requires_valid_range(__first1, __last1);
1593 __glibcxx_requires_valid_range(__first2, __last2);
1595 return _GLIBCXX_STD_A::__equal4(__first1, __last1, __first2, __last2,
1615 template<
typename _II1,
typename _II2>
1616 _GLIBCXX20_CONSTEXPR
1618 lexicographical_compare(_II1 __first1, _II1 __last1,
1619 _II2 __first2, _II2 __last2)
1621 #ifdef _GLIBCXX_CONCEPT_CHECKS
1626 __glibcxx_function_requires(_InputIteratorConcept<_II1>)
1627 __glibcxx_function_requires(_InputIteratorConcept<_II2>)
1628 __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
1629 __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
1630 __glibcxx_requires_valid_range(__first1, __last1);
1631 __glibcxx_requires_valid_range(__first2, __last2);
1633 return std::__lexicographical_compare_aux(std::__niter_base(__first1),
1634 std::__niter_base(__last1),
1635 std::__niter_base(__first2),
1636 std::__niter_base(__last2));
1652 template<
typename _II1,
typename _II2,
typename _Compare>
1653 _GLIBCXX20_CONSTEXPR
1655 lexicographical_compare(_II1 __first1, _II1 __last1,
1656 _II2 __first2, _II2 __last2, _Compare __comp)
1659 __glibcxx_function_requires(_InputIteratorConcept<_II1>)
1660 __glibcxx_function_requires(_InputIteratorConcept<_II2>)
1661 __glibcxx_requires_valid_range(__first1, __last1);
1662 __glibcxx_requires_valid_range(__first2, __last2);
1664 return std::__lexicographical_compare_impl
1665 (__first1, __last1, __first2, __last2,
1666 __gnu_cxx::__ops::__iter_comp_iter(__comp));
1669 #if __cpp_lib_three_way_comparison
1672 template<
typename _Iter>
1673 concept __is_byte_iter = contiguous_iterator<_Iter>
1674 && __is_byte<iter_value_t<_Iter>>::__value != 0
1675 && !__gnu_cxx::__numeric_traits<iter_value_t<_Iter>>::__is_signed;
1679 template<
typename _Tp>
1681 __min_cmp(_Tp __x, _Tp __y)
1685 decltype(__x <=> __y) _M_cmp;
1687 auto __c = __x <=> __y;
1689 return _Res{__y, __c};
1690 return _Res{__x, __c};
1704 template<
typename _InputIter1,
typename _InputIter2,
typename _Comp>
1706 lexicographical_compare_three_way(_InputIter1 __first1,
1707 _InputIter1 __last1,
1708 _InputIter2 __first2,
1709 _InputIter2 __last2,
1711 -> decltype(__comp(*__first1, *__first2))
1714 __glibcxx_function_requires(_InputIteratorConcept<_InputIter1>)
1715 __glibcxx_function_requires(_InputIteratorConcept<_InputIter2>)
1716 __glibcxx_requires_valid_range(__first1, __last1);
1717 __glibcxx_requires_valid_range(__first2, __last2);
1719 #if __cpp_lib_is_constant_evaluated
1720 using _Cat = decltype(__comp(*__first1, *__first2));
1721 static_assert(same_as<common_comparison_category_t<_Cat>, _Cat>);
1723 if (!std::is_constant_evaluated())
1724 if constexpr (same_as<_Comp, __detail::_Synth3way>
1725 || same_as<_Comp, compare_three_way>)
1726 if constexpr (__is_byte_iter<_InputIter1>)
1727 if constexpr (__is_byte_iter<_InputIter2>)
1729 const auto [__len, __lencmp]
1730 = std::__min_cmp(__last1 - __first1, __last2 - __first2);
1734 = __builtin_memcmp(&*__first1, &*__first2, __len) <=> 0;
1740 #endif // is_constant_evaluated
1741 while (__first1 != __last1 && __first2 != __last2)
1743 if (
auto __cmp = __comp(*__first1, *__first2); __cmp != 0)
1748 return __first1 != __last1 ? strong_ordering::greater
1752 template<
typename _InputIter1,
typename _InputIter2>
1754 lexicographical_compare_three_way(_InputIter1 __first1,
1755 _InputIter1 __last1,
1756 _InputIter2 __first2,
1757 _InputIter2 __last2)
1759 return std::lexicographical_compare_three_way(__first1, __last1,
1761 compare_three_way{});
1763 #endif // three_way_comparison
1765 template<
typename _InputIterator1,
typename _InputIterator2,
1766 typename _BinaryPredicate>
1767 _GLIBCXX20_CONSTEXPR
1768 pair<_InputIterator1, _InputIterator2>
1769 __mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1770 _InputIterator2 __first2, _BinaryPredicate __binary_pred)
1772 while (__first1 != __last1 && __binary_pred(__first1, __first2))
1777 return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
1793 template<
typename _InputIterator1,
typename _InputIterator2>
1794 _GLIBCXX20_CONSTEXPR
1795 inline pair<_InputIterator1, _InputIterator2>
1796 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1797 _InputIterator2 __first2)
1800 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
1801 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
1802 __glibcxx_function_requires(_EqualOpConcept<
1805 __glibcxx_requires_valid_range(__first1, __last1);
1807 return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2,
1808 __gnu_cxx::__ops::__iter_equal_to_iter());
1827 template<
typename _InputIterator1,
typename _InputIterator2,
1828 typename _BinaryPredicate>
1829 _GLIBCXX20_CONSTEXPR
1830 inline pair<_InputIterator1, _InputIterator2>
1831 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1832 _InputIterator2 __first2, _BinaryPredicate __binary_pred)
1835 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
1836 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
1837 __glibcxx_requires_valid_range(__first1, __last1);
1839 return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2,
1840 __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
1843 #if __cplusplus > 201103L
1845 template<
typename _InputIterator1,
typename _InputIterator2,
1846 typename _BinaryPredicate>
1847 _GLIBCXX20_CONSTEXPR
1848 pair<_InputIterator1, _InputIterator2>
1849 __mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1850 _InputIterator2 __first2, _InputIterator2 __last2,
1851 _BinaryPredicate __binary_pred)
1853 while (__first1 != __last1 && __first2 != __last2
1854 && __binary_pred(__first1, __first2))
1859 return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
1876 template<
typename _InputIterator1,
typename _InputIterator2>
1877 _GLIBCXX20_CONSTEXPR
1878 inline pair<_InputIterator1, _InputIterator2>
1879 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1880 _InputIterator2 __first2, _InputIterator2 __last2)
1883 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
1884 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
1885 __glibcxx_function_requires(_EqualOpConcept<
1888 __glibcxx_requires_valid_range(__first1, __last1);
1889 __glibcxx_requires_valid_range(__first2, __last2);
1891 return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2, __last2,
1892 __gnu_cxx::__ops::__iter_equal_to_iter());
1912 template<
typename _InputIterator1,
typename _InputIterator2,
1913 typename _BinaryPredicate>
1914 _GLIBCXX20_CONSTEXPR
1915 inline pair<_InputIterator1, _InputIterator2>
1916 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1917 _InputIterator2 __first2, _InputIterator2 __last2,
1918 _BinaryPredicate __binary_pred)
1921 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
1922 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
1923 __glibcxx_requires_valid_range(__first1, __last1);
1924 __glibcxx_requires_valid_range(__first2, __last2);
1926 return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2, __last2,
1927 __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
1931 _GLIBCXX_END_NAMESPACE_ALGO
1932 _GLIBCXX_END_NAMESPACE_VERSION
1938 #ifdef _GLIBCXX_PARALLEL