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<
typename _Tp>
90 __memcmp(
const _Tp* __first1,
const _Tp* __first2,
size_t __num)
92 #ifdef __cpp_lib_is_constant_evaluated
93 if (std::is_constant_evaluated())
95 for(; __num > 0; ++__first1, ++__first2, --__num)
96 if (*__first1 != *__first2)
97 return *__first1 < *__first2 ? -1 : 1;
102 return __builtin_memcmp(__first1, __first2,
sizeof(_Tp) * __num);
105 #if __cplusplus < 201103L
109 template<
bool _BoolType>
112 template<
typename _ForwardIterator1,
typename _ForwardIterator2>
114 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
116 typedef typename iterator_traits<_ForwardIterator1>::value_type
118 _ValueType1 __tmp = *__a;
125 struct __iter_swap<true>
127 template<
typename _ForwardIterator1,
typename _ForwardIterator2>
129 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
146 template<
typename _ForwardIterator1,
typename _ForwardIterator2>
149 iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
152 __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
154 __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
157 #if __cplusplus < 201103L
163 __glibcxx_function_requires(_ConvertibleConcept<_ValueType1,
165 __glibcxx_function_requires(_ConvertibleConcept<_ValueType2,
172 std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value
173 && __are_same<_ValueType1&, _ReferenceType1>::__value
174 && __are_same<_ValueType2&, _ReferenceType2>::__value>::
195 template<
typename _ForwardIterator1,
typename _ForwardIterator2>
198 swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
199 _ForwardIterator2 __first2)
202 __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
204 __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
206 __glibcxx_requires_valid_range(__first1, __last1);
208 for (; __first1 != __last1; ++__first1, (void)++__first2)
224 template<
typename _Tp>
227 min(
const _Tp& __a,
const _Tp& __b)
230 __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
248 template<
typename _Tp>
251 max(
const _Tp& __a,
const _Tp& __b)
254 __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
272 template<
typename _Tp,
typename _Compare>
275 min(
const _Tp& __a,
const _Tp& __b, _Compare __comp)
278 if (__comp(__b, __a))
294 template<
typename _Tp,
typename _Compare>
297 max(
const _Tp& __a,
const _Tp& __b, _Compare __comp)
300 if (__comp(__a, __b))
307 template<
typename _Iterator>
310 __niter_base(_Iterator __it)
317 template<
typename _From,
typename _To>
320 __niter_wrap(_From __from, _To __res)
321 {
return __from + (__res - std::__niter_base(__from)); }
324 template<
typename _Iterator>
327 __niter_wrap(
const _Iterator&, _Iterator __res)
336 template<
bool _IsMove,
bool _IsSimple,
typename _Category>
339 template<
typename _II,
typename _OI>
342 __copy_m(_II __first, _II __last, _OI __result)
344 for (; __first != __last; ++__result, (void)++__first)
345 *__result = *__first;
350 #if __cplusplus >= 201103L
351 template<
typename _Category>
352 struct __copy_move<true, false, _Category>
354 template<
typename _II,
typename _OI>
357 __copy_m(_II __first, _II __last, _OI __result)
359 for (; __first != __last; ++__result, (void)++__first)
367 struct __copy_move<false, false, random_access_iterator_tag>
369 template<
typename _II,
typename _OI>
372 __copy_m(_II __first, _II __last, _OI __result)
374 typedef typename iterator_traits<_II>::difference_type _Distance;
375 for(_Distance __n = __last - __first; __n > 0; --__n)
377 *__result = *__first;
385 #if __cplusplus >= 201103L
387 struct __copy_move<true, false, random_access_iterator_tag>
389 template<
typename _II,
typename _OI>
392 __copy_m(_II __first, _II __last, _OI __result)
394 typedef typename iterator_traits<_II>::difference_type _Distance;
395 for(_Distance __n = __last - __first; __n > 0; --__n)
406 template<
bool _IsMove>
407 struct __copy_move<_IsMove, true, random_access_iterator_tag>
409 template<
typename _Tp>
412 __copy_m(
const _Tp* __first,
const _Tp* __last, _Tp* __result)
414 #if __cplusplus >= 201103L
415 using __assignable = conditional<_IsMove,
416 is_move_assignable<_Tp>,
417 is_copy_assignable<_Tp>>;
419 static_assert( __assignable::type::value,
"type is not assignable" );
421 const ptrdiff_t _Num = __last - __first;
423 __builtin_memmove(__result, __first,
sizeof(_Tp) * _Num);
424 return __result + _Num;
430 template<
typename _CharT>
433 template<
typename _CharT,
typename _Traits>
434 class istreambuf_iterator;
436 template<
typename _CharT,
typename _Traits>
437 class ostreambuf_iterator;
439 template<
bool _IsMove,
typename _CharT>
440 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
441 ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
442 __copy_move_a2(_CharT*, _CharT*,
443 ostreambuf_iterator<_CharT, char_traits<_CharT> >);
445 template<
bool _IsMove,
typename _CharT>
446 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
447 ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
448 __copy_move_a2(
const _CharT*,
const _CharT*,
449 ostreambuf_iterator<_CharT, char_traits<_CharT> >);
451 template<
bool _IsMove,
typename _CharT>
452 typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
454 __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
455 istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
457 template<
bool _IsMove,
typename _II,
typename _OI>
460 __copy_move_a2(_II __first, _II __last, _OI __result)
462 typedef typename iterator_traits<_II>::iterator_category _Category;
463 #ifdef __cpp_lib_is_constant_evaluated
464 if (std::is_constant_evaluated())
465 return std::__copy_move<_IsMove, false, _Category>::
466 __copy_m(__first, __last, __result);
468 typedef typename iterator_traits<_II>::value_type _ValueTypeI;
469 typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
470 const bool __simple = (__is_trivially_copyable(_ValueTypeI)
471 && __is_pointer<_II>::__value
472 && __is_pointer<_OI>::__value
473 && __are_same<_ValueTypeI, _ValueTypeO>::__value);
474 return std::__copy_move<_IsMove, __simple,
475 _Category>::__copy_m(__first, __last, __result);
478 _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
480 template<
typename _Tp,
typename _Ref,
typename _Ptr>
483 _GLIBCXX_END_NAMESPACE_CONTAINER
485 template<
bool _IsMove,
486 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
488 __copy_move_a1(_GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
489 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
492 template<
bool _IsMove,
493 typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp>
494 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
495 __copy_move_a1(_GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr>,
496 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr>,
497 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>);
499 template<
bool _IsMove,
typename _II,
typename _Tp>
500 typename __gnu_cxx::__enable_if<
501 __is_random_access_iter<_II>::__value,
502 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> >::__type
503 __copy_move_a1(_II, _II, _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>);
505 template<
bool _IsMove,
typename _II,
typename _OI>
508 __copy_move_a1(_II __first, _II __last, _OI __result)
509 {
return std::__copy_move_a2<_IsMove>(__first, __last, __result); }
511 template<
bool _IsMove,
typename _II,
typename _OI>
514 __copy_move_a(_II __first, _II __last, _OI __result)
516 return std::__niter_wrap(__result,
517 std::__copy_move_a1<_IsMove>(std::__niter_base(__first),
518 std::__niter_base(__last),
519 std::__niter_base(__result)));
522 template<
bool _IsMove,
523 typename _Ite,
typename _Seq,
typename _Cat,
typename _OI>
525 __copy_move_a(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
526 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
529 template<
bool _IsMove,
530 typename _II,
typename _Ite,
typename _Seq,
typename _Cat>
532 __copy_move_a(_II, _II,
533 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&);
535 template<
bool _IsMove,
536 typename _IIte,
typename _ISeq,
typename _ICat,
537 typename _OIte,
typename _OSeq,
typename _OCat>
539 __copy_move_a(const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&,
540 const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&,
541 const ::__gnu_debug::_Safe_iterator<_OIte, _OSeq, _OCat>&);
560 template<
typename _II,
typename _OI>
563 copy(_II __first, _II __last, _OI __result)
566 __glibcxx_function_requires(_InputIteratorConcept<_II>)
567 __glibcxx_function_requires(_OutputIteratorConcept<_OI,
569 __glibcxx_requires_can_increment_range(__first, __last, __result);
571 return std::__copy_move_a<__is_move_iterator<_II>::__value>
572 (std::__miter_base(__first), std::__miter_base(__last), __result);
575 #if __cplusplus >= 201103L
593 template<
typename _II,
typename _OI>
596 move(_II __first, _II __last, _OI __result)
599 __glibcxx_function_requires(_InputIteratorConcept<_II>)
600 __glibcxx_function_requires(_OutputIteratorConcept<_OI,
602 __glibcxx_requires_can_increment_range(__first, __last, __result);
604 return std::__copy_move_a<true>(std::__miter_base(__first),
605 std::__miter_base(__last), __result);
608 #define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::move(_Tp, _Up, _Vp)
610 #define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::copy(_Tp, _Up, _Vp)
613 template<
bool _IsMove,
bool _IsSimple,
typename _Category>
614 struct __copy_move_backward
616 template<
typename _BI1,
typename _BI2>
619 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
621 while (__first != __last)
622 *--__result = *--__last;
627 #if __cplusplus >= 201103L
628 template<
typename _Category>
629 struct __copy_move_backward<true, false, _Category>
631 template<
typename _BI1,
typename _BI2>
634 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
636 while (__first != __last)
644 struct __copy_move_backward<false, false, random_access_iterator_tag>
646 template<
typename _BI1,
typename _BI2>
649 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
651 typename iterator_traits<_BI1>::difference_type
652 __n = __last - __first;
653 for (; __n > 0; --__n)
654 *--__result = *--__last;
659 #if __cplusplus >= 201103L
661 struct __copy_move_backward<true, false, random_access_iterator_tag>
663 template<
typename _BI1,
typename _BI2>
666 __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
668 typename iterator_traits<_BI1>::difference_type
669 __n = __last - __first;
670 for (; __n > 0; --__n)
677 template<
bool _IsMove>
678 struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
680 template<
typename _Tp>
683 __copy_move_b(
const _Tp* __first,
const _Tp* __last, _Tp* __result)
685 #if __cplusplus >= 201103L
686 using __assignable = conditional<_IsMove,
687 is_move_assignable<_Tp>,
688 is_copy_assignable<_Tp>>;
690 static_assert( __assignable::type::value,
"type is not assignable" );
692 const ptrdiff_t _Num = __last - __first;
694 __builtin_memmove(__result - _Num, __first,
sizeof(_Tp) * _Num);
695 return __result - _Num;
699 template<
bool _IsMove,
typename _BI1,
typename _BI2>
702 __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
704 typedef typename iterator_traits<_BI1>::iterator_category _Category;
705 #ifdef __cpp_lib_is_constant_evaluated
706 if (std::is_constant_evaluated())
707 return std::__copy_move_backward<_IsMove, false, _Category>::
708 __copy_move_b(__first, __last, __result);
710 typedef typename iterator_traits<_BI1>::value_type _ValueType1;
711 typedef typename iterator_traits<_BI2>::value_type _ValueType2;
712 const bool __simple = (__is_trivially_copyable(_ValueType1)
713 && __is_pointer<_BI1>::__value
714 && __is_pointer<_BI2>::__value
715 && __are_same<_ValueType1, _ValueType2>::__value);
717 return std::__copy_move_backward<_IsMove, __simple,
718 _Category>::__copy_move_b(__first,
723 template<
bool _IsMove,
typename _BI1,
typename _BI2>
726 __copy_move_backward_a1(_BI1 __first, _BI1 __last, _BI2 __result)
727 {
return std::__copy_move_backward_a2<_IsMove>(__first, __last, __result); }
729 template<
bool _IsMove,
730 typename _Tp,
typename _Ref,
typename _Ptr,
typename _OI>
732 __copy_move_backward_a1(_GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
733 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
736 template<
bool _IsMove,
737 typename _ITp,
typename _IRef,
typename _IPtr,
typename _OTp>
738 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>
739 __copy_move_backward_a1(
740 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr>,
741 _GLIBCXX_STD_C::_Deque_iterator<_ITp, _IRef, _IPtr>,
742 _GLIBCXX_STD_C::_Deque_iterator<_OTp, _OTp&, _OTp*>);
744 template<
bool _IsMove,
typename _II,
typename _Tp>
745 typename __gnu_cxx::__enable_if<
746 __is_random_access_iter<_II>::__value,
747 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*> >::__type
748 __copy_move_backward_a1(_II, _II,
749 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>);
751 template<
bool _IsMove,
typename _II,
typename _OI>
754 __copy_move_backward_a(_II __first, _II __last, _OI __result)
756 return std::__niter_wrap(__result,
757 std::__copy_move_backward_a1<_IsMove>
758 (std::__niter_base(__first), std::__niter_base(__last),
759 std::__niter_base(__result)));
762 template<
bool _IsMove,
763 typename _Ite,
typename _Seq,
typename _Cat,
typename _OI>
765 __copy_move_backward_a(
766 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
767 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
770 template<
bool _IsMove,
771 typename _II,
typename _Ite,
typename _Seq,
typename _Cat>
773 __copy_move_backward_a(_II, _II,
774 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&);
776 template<
bool _IsMove,
777 typename _IIte,
typename _ISeq,
typename _ICat,
778 typename _OIte,
typename _OSeq,
typename _OCat>
780 __copy_move_backward_a(
781 const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&,
782 const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&,
783 const ::__gnu_debug::_Safe_iterator<_OIte, _OSeq, _OCat>&);
803 template<
typename _BI1,
typename _BI2>
806 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
809 __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>)
810 __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>)
811 __glibcxx_function_requires(_ConvertibleConcept<
814 __glibcxx_requires_can_decrement_range(__first, __last, __result);
816 return std::__copy_move_backward_a<__is_move_iterator<_BI1>::__value>
817 (std::__miter_base(__first), std::__miter_base(__last), __result);
820 #if __cplusplus >= 201103L
839 template<
typename _BI1,
typename _BI2>
845 __glibcxx_function_requires(_BidirectionalIteratorConcept<_BI1>)
846 __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>)
847 __glibcxx_function_requires(_ConvertibleConcept<
850 __glibcxx_requires_can_decrement_range(__first, __last, __result);
852 return std::__copy_move_backward_a<true>(std::__miter_base(__first),
853 std::__miter_base(__last),
857 #define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::move_backward(_Tp, _Up, _Vp)
859 #define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::copy_backward(_Tp, _Up, _Vp)
862 template<
typename _ForwardIterator,
typename _Tp>
865 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value,
void>::__type
866 __fill_a1(_ForwardIterator __first, _ForwardIterator __last,
869 for (; __first != __last; ++__first)
873 template<
typename _ForwardIterator,
typename _Tp>
876 __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value,
void>::__type
877 __fill_a1(_ForwardIterator __first, _ForwardIterator __last,
880 const _Tp __tmp = __value;
881 for (; __first != __last; ++__first)
886 template<
typename _Tp>
888 __gnu_cxx::__enable_if<__is_byte<_Tp>::__value,
void>::__type
889 __fill_a1(_Tp* __first, _Tp* __last,
const _Tp& __c)
891 const _Tp __tmp = __c;
892 if (
const size_t __len = __last - __first)
893 __builtin_memset(__first, static_cast<unsigned char>(__tmp), __len);
896 template<
typename _Ite,
typename _Cont,
typename _Tp>
899 __fill_a1(::__gnu_cxx::__normal_iterator<_Ite, _Cont> __first,
900 ::__gnu_cxx::__normal_iterator<_Ite, _Cont> __last,
902 { std::__fill_a1(__first.base(), __last.base(), __value); }
904 template<
typename _Tp,
typename _VTp>
906 __fill_a1(
const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>&,
907 const _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Tp&, _Tp*>&,
910 template<
typename _FIte,
typename _Tp>
913 __fill_a(_FIte __first, _FIte __last,
const _Tp& __value)
914 { std::__fill_a1(__first, __last, __value); }
916 template<
typename _Ite,
typename _Seq,
typename _Cat,
typename _Tp>
918 __fill_a(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
919 const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>&,
934 template<
typename _ForwardIterator,
typename _Tp>
937 fill(_ForwardIterator __first, _ForwardIterator __last,
const _Tp& __value)
940 __glibcxx_function_requires(_Mutable_ForwardIteratorConcept<
942 __glibcxx_requires_valid_range(__first, __last);
944 std::__fill_a(__first, __last, __value);
948 inline _GLIBCXX_CONSTEXPR
int
949 __size_to_integer(
int __n) {
return __n; }
950 inline _GLIBCXX_CONSTEXPR
unsigned
951 __size_to_integer(
unsigned __n) {
return __n; }
952 inline _GLIBCXX_CONSTEXPR
long
953 __size_to_integer(
long __n) {
return __n; }
954 inline _GLIBCXX_CONSTEXPR
unsigned long
955 __size_to_integer(
unsigned long __n) {
return __n; }
956 inline _GLIBCXX_CONSTEXPR
long long
957 __size_to_integer(
long long __n) {
return __n; }
958 inline _GLIBCXX_CONSTEXPR
unsigned long long
959 __size_to_integer(
unsigned long long __n) {
return __n; }
961 #if defined(__GLIBCXX_TYPE_INT_N_0)
962 inline _GLIBCXX_CONSTEXPR __GLIBCXX_TYPE_INT_N_0
963 __size_to_integer(__GLIBCXX_TYPE_INT_N_0 __n) {
return __n; }
964 inline _GLIBCXX_CONSTEXPR
unsigned __GLIBCXX_TYPE_INT_N_0
965 __size_to_integer(
unsigned __GLIBCXX_TYPE_INT_N_0 __n) {
return __n; }
967 #if defined(__GLIBCXX_TYPE_INT_N_1)
968 inline _GLIBCXX_CONSTEXPR __GLIBCXX_TYPE_INT_N_1
969 __size_to_integer(__GLIBCXX_TYPE_INT_N_1 __n) {
return __n; }
970 inline _GLIBCXX_CONSTEXPR
unsigned __GLIBCXX_TYPE_INT_N_1
971 __size_to_integer(
unsigned __GLIBCXX_TYPE_INT_N_1 __n) {
return __n; }
973 #if defined(__GLIBCXX_TYPE_INT_N_2)
974 inline _GLIBCXX_CONSTEXPR __GLIBCXX_TYPE_INT_N_2
975 __size_to_integer(__GLIBCXX_TYPE_INT_N_2 __n) {
return __n; }
976 inline _GLIBCXX_CONSTEXPR
unsigned __GLIBCXX_TYPE_INT_N_2
977 __size_to_integer(
unsigned __GLIBCXX_TYPE_INT_N_2 __n) {
return __n; }
979 #if defined(__GLIBCXX_TYPE_INT_N_3)
980 inline _GLIBCXX_CONSTEXPR
unsigned __GLIBCXX_TYPE_INT_N_3
981 __size_to_integer(__GLIBCXX_TYPE_INT_N_3 __n) {
return __n; }
982 inline _GLIBCXX_CONSTEXPR __GLIBCXX_TYPE_INT_N_3
983 __size_to_integer(
unsigned __GLIBCXX_TYPE_INT_N_3 __n) {
return __n; }
986 inline _GLIBCXX_CONSTEXPR
long long
987 __size_to_integer(
float __n) {
return __n; }
988 inline _GLIBCXX_CONSTEXPR
long long
989 __size_to_integer(
double __n) {
return __n; }
990 inline _GLIBCXX_CONSTEXPR
long long
991 __size_to_integer(
long double __n) {
return __n; }
992 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
993 inline _GLIBCXX_CONSTEXPR
long long
994 __size_to_integer(__float128 __n) {
return __n; }
997 template<
typename _OutputIterator,
typename _Size,
typename _Tp>
1000 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
1001 __fill_n_a1(_OutputIterator __first, _Size __n,
const _Tp& __value)
1003 for (; __n > 0; --__n, (void) ++__first)
1008 template<
typename _OutputIterator,
typename _Size,
typename _Tp>
1009 _GLIBCXX20_CONSTEXPR
1011 __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
1012 __fill_n_a1(_OutputIterator __first, _Size __n,
const _Tp& __value)
1014 const _Tp __tmp = __value;
1015 for (; __n > 0; --__n, (void) ++__first)
1020 template<
typename _Ite,
typename _Seq,
typename _Cat,
typename _Size,
1023 __fill_n_a(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, _Cat>& __first,
1024 _Size __n,
const _Tp& __value,
1027 template<
typename _OutputIterator,
typename _Size,
typename _Tp>
1028 _GLIBCXX20_CONSTEXPR
1029 inline _OutputIterator
1030 __fill_n_a(_OutputIterator __first, _Size __n,
const _Tp& __value,
1033 #if __cplusplus >= 201103L
1034 static_assert(is_integral<_Size>{},
"fill_n must pass integral size");
1036 return __fill_n_a1(__first, __n, __value);
1039 template<
typename _OutputIterator,
typename _Size,
typename _Tp>
1040 _GLIBCXX20_CONSTEXPR
1041 inline _OutputIterator
1042 __fill_n_a(_OutputIterator __first, _Size __n,
const _Tp& __value,
1045 #if __cplusplus >= 201103L
1046 static_assert(is_integral<_Size>{},
"fill_n must pass integral size");
1048 return __fill_n_a1(__first, __n, __value);
1051 template<
typename _OutputIterator,
typename _Size,
typename _Tp>
1052 _GLIBCXX20_CONSTEXPR
1053 inline _OutputIterator
1054 __fill_n_a(_OutputIterator __first, _Size __n,
const _Tp& __value,
1057 #if __cplusplus >= 201103L
1058 static_assert(is_integral<_Size>{},
"fill_n must pass integral size");
1063 __glibcxx_requires_can_increment(__first, __n);
1065 std::__fill_a(__first, __first + __n, __value);
1066 return __first + __n;
1086 template<
typename _OI,
typename _Size,
typename _Tp>
1087 _GLIBCXX20_CONSTEXPR
1089 fill_n(_OI __first, _Size __n,
const _Tp& __value)
1092 __glibcxx_function_requires(_OutputIteratorConcept<_OI, _Tp>)
1094 return std::__fill_n_a(__first, std::__size_to_integer(__n), __value,
1098 template<
bool _BoolType>
1101 template<
typename _II1,
typename _II2>
1102 _GLIBCXX20_CONSTEXPR
1104 equal(_II1 __first1, _II1 __last1, _II2 __first2)
1106 for (; __first1 != __last1; ++__first1, (void) ++__first2)
1107 if (!(*__first1 == *__first2))
1114 struct __equal<true>
1116 template<
typename _Tp>
1117 _GLIBCXX20_CONSTEXPR
1119 equal(
const _Tp* __first1,
const _Tp* __last1,
const _Tp* __first2)
1121 if (
const size_t __len = (__last1 - __first1))
1122 return !std::__memcmp(__first1, __first2, __len);
1127 template<
typename _Tp,
typename _Ref,
typename _Ptr,
typename _II>
1128 typename __gnu_cxx::__enable_if<
1129 __is_random_access_iter<_II>::__value,
bool>::__type
1130 __equal_aux1(_GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
1131 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>,
1134 template<
typename _Tp1,
typename _Ref1,
typename _Ptr1,
1135 typename _Tp2,
typename _Ref2,
typename _Ptr2>
1137 __equal_aux1(_GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1>,
1138 _GLIBCXX_STD_C::_Deque_iterator<_Tp1, _Ref1, _Ptr1>,
1139 _GLIBCXX_STD_C::_Deque_iterator<_Tp2, _Ref2, _Ptr2>);
1141 template<
typename _II,
typename _Tp,
typename _Ref,
typename _Ptr>
1142 typename __gnu_cxx::__enable_if<
1143 __is_random_access_iter<_II>::__value,
bool>::__type
1144 __equal_aux1(_II, _II,
1145 _GLIBCXX_STD_C::_Deque_iterator<_Tp, _Ref, _Ptr>);
1147 template<
typename _II1,
typename _II2>
1148 _GLIBCXX20_CONSTEXPR
1150 __equal_aux1(_II1 __first1, _II1 __last1, _II2 __first2)
1152 typedef typename iterator_traits<_II1>::value_type _ValueType1;
1153 typedef typename iterator_traits<_II2>::value_type _ValueType2;
1154 const bool __simple = ((__is_integer<_ValueType1>::__value
1155 || __is_pointer<_ValueType1>::__value)
1156 && __is_pointer<_II1>::__value
1157 && __is_pointer<_II2>::__value
1158 && __are_same<_ValueType1, _ValueType2>::__value);
1163 template<
typename _II1,
typename _II2>
1164 _GLIBCXX20_CONSTEXPR
1166 __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
1168 return std::__equal_aux1(std::__niter_base(__first1),
1169 std::__niter_base(__last1),
1170 std::__niter_base(__first2));
1173 template<
typename _II1,
typename _Seq1,
typename _Cat1,
typename _II2>
1175 __equal_aux(const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&,
1176 const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&,
1179 template<
typename _II1,
typename _II2,
typename _Seq2,
typename _Cat2>
1181 __equal_aux(_II1, _II1,
1182 const ::__gnu_debug::_Safe_iterator<_II2, _Seq2, _Cat2>&);
1184 template<
typename _II1,
typename _Seq1,
typename _Cat1,
1185 typename _II2,
typename _Seq2,
typename _Cat2>
1187 __equal_aux(const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&,
1188 const ::__gnu_debug::_Safe_iterator<_II1, _Seq1, _Cat1>&,
1189 const ::__gnu_debug::_Safe_iterator<_II2, _Seq2, _Cat2>&);
1191 template<
typename,
typename>
1194 template<
typename _II1,
typename _II2>
1195 _GLIBCXX20_CONSTEXPR
1197 __newlast1(_II1, _II1 __last1, _II2, _II2)
1200 template<
typename _II>
1201 _GLIBCXX20_CONSTEXPR
1203 __cnd2(_II __first, _II __last)
1204 {
return __first != __last; }
1208 struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
1210 template<
typename _RAI1,
typename _RAI2>
1211 _GLIBCXX20_CONSTEXPR
1213 __newlast1(_RAI1 __first1, _RAI1 __last1,
1214 _RAI2 __first2, _RAI2 __last2)
1216 const typename iterator_traits<_RAI1>::difference_type
1217 __diff1 = __last1 - __first1;
1218 const typename iterator_traits<_RAI2>::difference_type
1219 __diff2 = __last2 - __first2;
1220 return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
1223 template<
typename _RAI>
1224 static _GLIBCXX20_CONSTEXPR
bool
1229 template<
typename _II1,
typename _II2,
typename _Compare>
1230 _GLIBCXX20_CONSTEXPR
1232 __lexicographical_compare_impl(_II1 __first1, _II1 __last1,
1233 _II2 __first2, _II2 __last2,
1236 typedef typename iterator_traits<_II1>::iterator_category _Category1;
1237 typedef typename iterator_traits<_II2>::iterator_category _Category2;
1238 typedef std::__lc_rai<_Category1, _Category2> __rai_type;
1240 __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
1241 for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
1242 ++__first1, (void)++__first2)
1244 if (__comp(__first1, __first2))
1246 if (__comp(__first2, __first1))
1249 return __first1 == __last1 && __first2 != __last2;
1252 template<
bool _BoolType>
1253 struct __lexicographical_compare
1255 template<
typename _II1,
typename _II2>
1256 _GLIBCXX20_CONSTEXPR
1258 __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
1260 using __gnu_cxx::__ops::__iter_less_iter;
1261 return std::__lexicographical_compare_impl(__first1, __last1,
1263 __iter_less_iter());
1268 struct __lexicographical_compare<true>
1270 template<
typename _Tp,
typename _Up>
1271 _GLIBCXX20_CONSTEXPR
1273 __lc(
const _Tp* __first1,
const _Tp* __last1,
1274 const _Up* __first2,
const _Up* __last2)
1276 const size_t __len1 = __last1 - __first1;
1277 const size_t __len2 = __last2 - __first2;
1278 if (
const size_t __len =
std::min(__len1, __len2))
1279 if (
int __result = std::__memcmp(__first1, __first2, __len))
1280 return __result < 0;
1281 return __len1 < __len2;
1285 template<
typename _II1,
typename _II2>
1286 _GLIBCXX20_CONSTEXPR
1288 __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
1289 _II2 __first2, _II2 __last2)
1291 typedef typename iterator_traits<_II1>::value_type _ValueType1;
1292 typedef typename iterator_traits<_II2>::value_type _ValueType2;
1293 const bool __simple =
1294 (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
1295 && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
1296 && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
1297 && __is_pointer<_II1>::__value
1298 && __is_pointer<_II2>::__value);
1300 return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
1304 template<
typename _ForwardIterator,
typename _Tp,
typename _Compare>
1305 _GLIBCXX20_CONSTEXPR
1307 __lower_bound(_ForwardIterator __first, _ForwardIterator __last,
1308 const _Tp& __val, _Compare __comp)
1310 typedef typename iterator_traits<_ForwardIterator>::difference_type
1317 _DistanceType __half = __len >> 1;
1318 _ForwardIterator __middle = __first;
1320 if (__comp(__middle, __val))
1324 __len = __len - __half - 1;
1343 template<
typename _ForwardIterator,
typename _Tp>
1344 _GLIBCXX20_CONSTEXPR
1345 inline _ForwardIterator
1346 lower_bound(_ForwardIterator __first, _ForwardIterator __last,
1350 __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
1351 __glibcxx_function_requires(_LessThanOpConcept<
1353 __glibcxx_requires_partitioned_lower(__first, __last, __val);
1355 return std::__lower_bound(__first, __last, __val,
1356 __gnu_cxx::__ops::__iter_less_val());
1361 inline _GLIBCXX_CONSTEXPR
int
1363 {
return (
int)
sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
1365 inline _GLIBCXX_CONSTEXPR
unsigned
1367 {
return (
int)
sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
1369 inline _GLIBCXX_CONSTEXPR
long
1371 {
return (
int)
sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
1373 inline _GLIBCXX_CONSTEXPR
unsigned long
1374 __lg(
unsigned long __n)
1375 {
return (
int)
sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
1377 inline _GLIBCXX_CONSTEXPR
long long
1379 {
return (
int)
sizeof(
long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
1381 inline _GLIBCXX_CONSTEXPR
unsigned long long
1382 __lg(
unsigned long long __n)
1383 {
return (
int)
sizeof(
long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
1385 _GLIBCXX_BEGIN_NAMESPACE_ALGO
1399 template<
typename _II1,
typename _II2>
1400 _GLIBCXX20_CONSTEXPR
1402 equal(_II1 __first1, _II1 __last1, _II2 __first2)
1405 __glibcxx_function_requires(_InputIteratorConcept<_II1>)
1406 __glibcxx_function_requires(_InputIteratorConcept<_II2>)
1407 __glibcxx_function_requires(_EqualOpConcept<
1410 __glibcxx_requires_can_increment_range(__first1, __last1, __first2);
1412 return std::__equal_aux(__first1, __last1, __first2);
1430 template<
typename _IIter1,
typename _IIter2,
typename _BinaryPredicate>
1431 _GLIBCXX20_CONSTEXPR
1433 equal(_IIter1 __first1, _IIter1 __last1,
1434 _IIter2 __first2, _BinaryPredicate __binary_pred)
1437 __glibcxx_function_requires(_InputIteratorConcept<_IIter1>)
1438 __glibcxx_function_requires(_InputIteratorConcept<_IIter2>)
1439 __glibcxx_requires_valid_range(__first1, __last1);
1441 for (; __first1 != __last1; ++__first1, (void)++__first2)
1442 if (!
bool(__binary_pred(*__first1, *__first2)))
1447 #if __cplusplus >= 201103L
1449 template<
typename _II1,
typename _II2>
1450 _GLIBCXX20_CONSTEXPR
1452 __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
1454 using _RATag = random_access_iterator_tag;
1455 using _Cat1 =
typename iterator_traits<_II1>::iterator_category;
1456 using _Cat2 =
typename iterator_traits<_II2>::iterator_category;
1457 using _RAIters = __and_<is_same<_Cat1, _RATag>, is_same<_Cat2, _RATag>>;
1467 for (; __first1 != __last1 && __first2 != __last2;
1468 ++__first1, (void)++__first2)
1469 if (!(*__first1 == *__first2))
1471 return __first1 == __last1 && __first2 == __last2;
1475 template<
typename _II1,
typename _II2,
typename _BinaryPredicate>
1476 _GLIBCXX20_CONSTEXPR
1478 __equal4(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2,
1479 _BinaryPredicate __binary_pred)
1481 using _RATag = random_access_iterator_tag;
1482 using _Cat1 =
typename iterator_traits<_II1>::iterator_category;
1483 using _Cat2 =
typename iterator_traits<_II2>::iterator_category;
1484 using _RAIters = __and_<is_same<_Cat1, _RATag>, is_same<_Cat2, _RATag>>;
1495 for (; __first1 != __last1 && __first2 != __last2;
1496 ++__first1, (void)++__first2)
1497 if (!
bool(__binary_pred(*__first1, *__first2)))
1499 return __first1 == __last1 && __first2 == __last2;
1503 #if __cplusplus > 201103L
1505 #define __cpp_lib_robust_nonmodifying_seq_ops 201304
1520 template<
typename _II1,
typename _II2>
1521 _GLIBCXX20_CONSTEXPR
1523 equal(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
1526 __glibcxx_function_requires(_InputIteratorConcept<_II1>)
1527 __glibcxx_function_requires(_InputIteratorConcept<_II2>)
1528 __glibcxx_function_requires(_EqualOpConcept<
1531 __glibcxx_requires_valid_range(__first1, __last1);
1532 __glibcxx_requires_valid_range(__first2, __last2);
1534 return _GLIBCXX_STD_A::__equal4(__first1, __last1, __first2, __last2);
1553 template<
typename _IIter1,
typename _IIter2,
typename _BinaryPredicate>
1554 _GLIBCXX20_CONSTEXPR
1556 equal(_IIter1 __first1, _IIter1 __last1,
1557 _IIter2 __first2, _IIter2 __last2, _BinaryPredicate __binary_pred)
1560 __glibcxx_function_requires(_InputIteratorConcept<_IIter1>)
1561 __glibcxx_function_requires(_InputIteratorConcept<_IIter2>)
1562 __glibcxx_requires_valid_range(__first1, __last1);
1563 __glibcxx_requires_valid_range(__first2, __last2);
1565 return _GLIBCXX_STD_A::__equal4(__first1, __last1, __first2, __last2,
1585 template<
typename _II1,
typename _II2>
1586 _GLIBCXX20_CONSTEXPR
1588 lexicographical_compare(_II1 __first1, _II1 __last1,
1589 _II2 __first2, _II2 __last2)
1591 #ifdef _GLIBCXX_CONCEPT_CHECKS
1596 __glibcxx_function_requires(_InputIteratorConcept<_II1>)
1597 __glibcxx_function_requires(_InputIteratorConcept<_II2>)
1598 __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>)
1599 __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>)
1600 __glibcxx_requires_valid_range(__first1, __last1);
1601 __glibcxx_requires_valid_range(__first2, __last2);
1603 return std::__lexicographical_compare_aux(std::__niter_base(__first1),
1604 std::__niter_base(__last1),
1605 std::__niter_base(__first2),
1606 std::__niter_base(__last2));
1622 template<
typename _II1,
typename _II2,
typename _Compare>
1623 _GLIBCXX20_CONSTEXPR
1625 lexicographical_compare(_II1 __first1, _II1 __last1,
1626 _II2 __first2, _II2 __last2, _Compare __comp)
1629 __glibcxx_function_requires(_InputIteratorConcept<_II1>)
1630 __glibcxx_function_requires(_InputIteratorConcept<_II2>)
1631 __glibcxx_requires_valid_range(__first1, __last1);
1632 __glibcxx_requires_valid_range(__first2, __last2);
1634 return std::__lexicographical_compare_impl
1635 (__first1, __last1, __first2, __last2,
1636 __gnu_cxx::__ops::__iter_comp_iter(__comp));
1639 #if __cpp_lib_three_way_comparison
1642 template<
typename _Iter>
1643 concept __is_byte_iter = contiguous_iterator<_Iter>
1644 && __is_byte<iter_value_t<_Iter>>::__value != 0
1645 && !__gnu_cxx::__numeric_traits<iter_value_t<_Iter>>::__is_signed;
1649 template<
typename _Tp>
1651 __min_cmp(_Tp __x, _Tp __y)
1655 decltype(__x <=> __y) _M_cmp;
1657 auto __c = __x <=> __y;
1659 return _Res{__y, __c};
1660 return _Res{__x, __c};
1674 template<
typename _InputIter1,
typename _InputIter2,
typename _Comp>
1676 lexicographical_compare_three_way(_InputIter1 __first1,
1677 _InputIter1 __last1,
1678 _InputIter2 __first2,
1679 _InputIter2 __last2,
1681 -> decltype(__comp(*__first1, *__first2))
1684 __glibcxx_function_requires(_InputIteratorConcept<_InputIter1>)
1685 __glibcxx_function_requires(_InputIteratorConcept<_InputIter2>)
1686 __glibcxx_requires_valid_range(__first1, __last1);
1687 __glibcxx_requires_valid_range(__first2, __last2);
1689 #if __cpp_lib_is_constant_evaluated
1690 using _Cat = decltype(__comp(*__first1, *__first2));
1691 static_assert(same_as<common_comparison_category_t<_Cat>, _Cat>);
1693 if (!std::is_constant_evaluated())
1694 if constexpr (same_as<_Comp, __detail::_Synth3way>
1695 || same_as<_Comp, compare_three_way>)
1696 if constexpr (__is_byte_iter<_InputIter1>)
1697 if constexpr (__is_byte_iter<_InputIter2>)
1699 const auto [__len, __lencmp]
1700 = std::__min_cmp(__last1 - __first1, __last2 - __first2);
1704 = __builtin_memcmp(&*__first1, &*__first2, __len) <=> 0;
1710 #endif // is_constant_evaluated
1711 while (__first1 != __last1 && __first2 != __last2)
1713 if (
auto __cmp = __comp(*__first1, *__first2); __cmp != 0)
1718 return __first1 != __last1 ? strong_ordering::greater
1722 template<
typename _InputIter1,
typename _InputIter2>
1724 lexicographical_compare_three_way(_InputIter1 __first1,
1725 _InputIter1 __last1,
1726 _InputIter2 __first2,
1727 _InputIter2 __last2)
1729 return std::lexicographical_compare_three_way(__first1, __last1,
1731 compare_three_way{});
1733 #endif // three_way_comparison
1735 template<
typename _InputIterator1,
typename _InputIterator2,
1736 typename _BinaryPredicate>
1737 _GLIBCXX20_CONSTEXPR
1738 pair<_InputIterator1, _InputIterator2>
1739 __mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1740 _InputIterator2 __first2, _BinaryPredicate __binary_pred)
1742 while (__first1 != __last1 && __binary_pred(__first1, __first2))
1747 return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
1763 template<
typename _InputIterator1,
typename _InputIterator2>
1764 _GLIBCXX20_CONSTEXPR
1765 inline pair<_InputIterator1, _InputIterator2>
1766 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1767 _InputIterator2 __first2)
1770 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
1771 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
1772 __glibcxx_function_requires(_EqualOpConcept<
1775 __glibcxx_requires_valid_range(__first1, __last1);
1777 return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2,
1778 __gnu_cxx::__ops::__iter_equal_to_iter());
1797 template<
typename _InputIterator1,
typename _InputIterator2,
1798 typename _BinaryPredicate>
1799 _GLIBCXX20_CONSTEXPR
1800 inline pair<_InputIterator1, _InputIterator2>
1801 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1802 _InputIterator2 __first2, _BinaryPredicate __binary_pred)
1805 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
1806 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
1807 __glibcxx_requires_valid_range(__first1, __last1);
1809 return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2,
1810 __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
1813 #if __cplusplus > 201103L
1815 template<
typename _InputIterator1,
typename _InputIterator2,
1816 typename _BinaryPredicate>
1817 _GLIBCXX20_CONSTEXPR
1818 pair<_InputIterator1, _InputIterator2>
1819 __mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1820 _InputIterator2 __first2, _InputIterator2 __last2,
1821 _BinaryPredicate __binary_pred)
1823 while (__first1 != __last1 && __first2 != __last2
1824 && __binary_pred(__first1, __first2))
1829 return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
1846 template<
typename _InputIterator1,
typename _InputIterator2>
1847 _GLIBCXX20_CONSTEXPR
1848 inline pair<_InputIterator1, _InputIterator2>
1849 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1850 _InputIterator2 __first2, _InputIterator2 __last2)
1853 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
1854 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
1855 __glibcxx_function_requires(_EqualOpConcept<
1858 __glibcxx_requires_valid_range(__first1, __last1);
1859 __glibcxx_requires_valid_range(__first2, __last2);
1861 return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2, __last2,
1862 __gnu_cxx::__ops::__iter_equal_to_iter());
1882 template<
typename _InputIterator1,
typename _InputIterator2,
1883 typename _BinaryPredicate>
1884 _GLIBCXX20_CONSTEXPR
1885 inline pair<_InputIterator1, _InputIterator2>
1886 mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
1887 _InputIterator2 __first2, _InputIterator2 __last2,
1888 _BinaryPredicate __binary_pred)
1891 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
1892 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
1893 __glibcxx_requires_valid_range(__first1, __last1);
1894 __glibcxx_requires_valid_range(__first2, __last2);
1896 return _GLIBCXX_STD_A::__mismatch(__first1, __last1, __first2, __last2,
1897 __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
1901 _GLIBCXX_END_NAMESPACE_ALGO
1902 _GLIBCXX_END_NAMESPACE_VERSION
1908 #ifdef _GLIBCXX_PARALLEL