• Home
  • Raw
  • Download

Lines Matching refs:__last

817 all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
819 for (; __first != __last; ++__first)
830 any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
832 for (; __first != __last; ++__first)
843 none_of(_InputIterator __first, _InputIterator __last, _Predicate __pred)
845 for (; __first != __last; ++__first)
856 for_each(_InputIterator __first, _InputIterator __last, _Function __f)
858 for (; __first != __last; ++__first)
888 find(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
890 for (; __first != __last; ++__first)
901 find_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
903 for (; __first != __last; ++__first)
914 find_if_not(_InputIterator __first, _InputIterator __last, _Predicate __pred)
916 for (; __first != __last; ++__first)
1109 adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
1111 if (__first != __last)
1114 while (++__i != __last)
1121 return __last;
1127 adjacent_find(_ForwardIterator __first, _ForwardIterator __last)
1130 return _VSTD::adjacent_find(__first, __last, __equal_to<__v>());
1138 count(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
1141 for (; __first != __last; ++__first)
1152 count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
1155 for (; __first != __last; ++__first)
1483 __search_n(_ForwardIterator __first, _ForwardIterator __last,
1493 if (__first == __last) // return __last if no element matches __value_
1494 return __last;
1506 if (++__m == __last) // Otherwise if source exhaused, pattern not found
1507 return __last;
1520 __search_n(_RandomAccessIterator __first, _RandomAccessIterator __last,
1525 _Size __len = static_cast<_Size>(__last - __first);
1527 return __last;
1528 …const _RandomAccessIterator __s = __last - (__count - 1); // Start of pattern match can't go beyo…
1534 if (__first >= __s) // return __last if no element matches __value_
1535 return __last;
1561 search_n(_ForwardIterator __first, _ForwardIterator __last,
1565 (__first, __last, __convert_to_integral(__count), __value_, __pred,
1572 search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_)
1575 return _VSTD::search_n(__first, __last, __convert_to_integral(__count),
1633 __copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1635 for (; __first != __last; ++__first, (void) ++__result)
1648 __copy(_Tp* __first, _Tp* __last, _Up* __result)
1650 const size_t __n = static_cast<size_t>(__last - __first);
1659 copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1661 return _VSTD::__copy(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
1669 __copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __re…
1671 while (__first != __last)
1672 *--__result = *--__last;
1684 __copy_backward(_Tp* __first, _Tp* __last, _Up* __result)
1686 const size_t __n = static_cast<size_t>(__last - __first);
1698 copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
1702 __unwrap_iter(__last),
1711 copy_if(_InputIterator __first, _InputIterator __last,
1714 for (; __first != __last; ++__first)
1772 __move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1774 for (; __first != __last; ++__first, (void) ++__result)
1787 __move(_Tp* __first, _Tp* __last, _Up* __result)
1789 const size_t __n = static_cast<size_t>(__last - __first);
1798 move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1800 return _VSTD::__move(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
1808 __move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
1810 while (__first != __last)
1811 *--__result = _VSTD::move(*--__last);
1823 __move_backward(_Tp* __first, _Tp* __last, _Up* __result)
1825 const size_t __n = static_cast<size_t>(__last - __first);
1837 move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
1840 …return _VSTD::__move_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__resul…
1852 transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation …
1854 for (; __first != __last; ++__first, (void) ++__result)
1875 replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new…
1877 for (; __first != __last; ++__first)
1887 replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_v…
1889 for (; __first != __last; ++__first)
1899 replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
1902 for (; __first != __last; ++__first, (void) ++__result)
1915 replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
1918 for (; __first != __last; ++__first, (void) ++__result)
1951 __fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag)
1953 for (; __first != __last; ++__first)
1960 __fill(_RandomAccessIterator __first, _RandomAccessIterator __last, const _Tp& __value_, random_acc…
1962 _VSTD::fill_n(__first, __last - __first, __value_);
1968 fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
1970 …_VSTD::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_cate…
1978 generate(_ForwardIterator __first, _ForwardIterator __last, _Generator __gen)
1980 for (; __first != __last; ++__first)
2002 remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
2004 __first = _VSTD::find(__first, __last, __value_);
2005 if (__first != __last)
2008 while (++__i != __last)
2024 remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
2027 (__first, __last, __pred);
2028 if (__first != __last)
2031 while (++__i != __last)
2048 remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __v…
2050 for (; __first != __last; ++__first)
2066 remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate …
2068 for (; __first != __last; ++__first)
2083 unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
2086 (__first, __last, __pred);
2087 if (__first != __last)
2092 for (++__i; ++__i != __last;)
2103 unique(_ForwardIterator __first, _ForwardIterator __last)
2106 return _VSTD::unique(__first, __last, __equal_to<__v>());
2113 __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredi…
2116 if (__first != __last)
2121 while (++__first != __last)
2136 __unique_copy(_ForwardIterator __first, _ForwardIterator __last, _OutputIterator __result, _BinaryP…
2139 if (__first != __last)
2144 while (++__first != __last)
2159 __unique_copy(_InputIterator __first, _InputIterator __last, _ForwardIterator __result, _BinaryPred…
2162 if (__first != __last)
2165 while (++__first != __last)
2176 unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredica…
2179 (__first, __last, __result, __pred,
2187 unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
2190 return _VSTD::unique_copy(__first, __last, __result, __equal_to<__v>());
2198 __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag)
2200 while (__first != __last)
2202 if (__first == --__last)
2204 _VSTD::iter_swap(__first, __last);
2212 __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_access_iterator_tag)
2214 if (__first != __last)
2215 for (; __first < --__last; ++__first)
2216 _VSTD::iter_swap(__first, __last);
2222 reverse(_BidirectionalIterator __first, _BidirectionalIterator __last)
2224 …_VSTD::__reverse(__first, __last, typename iterator_traits<_BidirectionalIterator>::iterator_categ…
2232 reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __resul…
2234 for (; __first != __last; ++__result)
2235 *__result = *--__last;
2243 __rotate_left(_ForwardIterator __first, _ForwardIterator __last)
2247 _ForwardIterator __lm1 = _VSTD::move(_VSTD::next(__first), __last, __first);
2254 __rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
2257 _BidirectionalIterator __lm1 = _VSTD::prev(__last);
2259 _BidirectionalIterator __fp1 = _VSTD::move_backward(__first, __lm1, __last);
2266 __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
2273 if (++__i == __last)
2286 if (++__i == __last)
2315 …te_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
2321 const difference_type __m2 = __last - __middle;
2337 const difference_type __d = __last - __p2;
2351 __rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
2358 return _VSTD::__rotate_left(__first, __last);
2360 return _VSTD::__rotate_forward(__first, __middle, __last);
2366 …ate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
2373 return _VSTD::__rotate_left(__first, __last);
2374 if (_VSTD::next(__middle) == __last)
2375 return _VSTD::__rotate_right(__first, __last);
2377 return _VSTD::__rotate_forward(__first, __middle, __last);
2383 …rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
2390 return _VSTD::__rotate_left(__first, __last);
2391 if (_VSTD::next(__middle) == __last)
2392 return _VSTD::__rotate_right(__first, __last);
2393 return _VSTD::__rotate_gcd(__first, __middle, __last);
2395 return _VSTD::__rotate_forward(__first, __middle, __last);
2401 rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
2404 return __last;
2405 if (__middle == __last)
2407 return _VSTD::__rotate(__first, __middle, __last,
2416 rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIt…
2418 return _VSTD::copy(__first, __middle, _VSTD::copy(__middle, __last, __result));
2426 min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
2430 if (__first != __last)
2433 while (++__i != __last)
2443 min_element(_ForwardIterator __first, _ForwardIterator __last)
2445 return _VSTD::min_element(__first, __last,
2492 max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
2496 if (__first != __last)
2499 while (++__i != __last)
2510 max_element(_ForwardIterator __first, _ForwardIterator __last)
2512 return _VSTD::max_element(__first, __last,
2580 minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
2585 if (__first != __last)
2587 if (++__first != __last)
2593 while (++__first != __last)
2596 if (++__first == __last)
2630 minmax_element(_ForwardIterator __first, _ForwardIterator __last)
2632 return _VSTD::minmax_element(__first, __last,
2664 _Iter __last = __t.end();
2677 while (__first != __last)
2983 random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
2988 difference_type __d = __last - __first;
2993 for (--__last, --__d; __first < __last; ++__first, --__d)
3004 random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
3012 difference_type __d = __last - __first;
3015 for (--__last; __first < __last; ++__first, --__d)
3029 _PopulationIterator __last, _SampleIterator __output_iter,
3035 for (; __first != __last && __k < __n; ++__first, (void)++__k)
3038 for (; __first != __last; ++__first, (void)++__k) {
3050 _PopulationIterator __last, _SampleIterator __output_iter,
3054 _Distance __unsampled_sz = _VSTD::distance(__first, __last);
3070 _PopulationIterator __last, _SampleIterator __output_iter,
3082 __first, __last, __output_iter, _CommonType(__n),
3091 _PopulationIterator __last, _SampleIterator __output_iter,
3093 return _VSTD::__sample(__first, __last, __output_iter, __n, __g);
3098 void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
3108 difference_type __d = __last - __first;
3112 for (--__last, --__d; __first < __last; ++__first, --__d)
3123 is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred)
3125 for (; __first != __last; ++__first)
3128 if ( __first == __last )
3131 for (; __first != __last; ++__first)
3141 __partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_…
3145 if (__first == __last)
3151 for (_ForwardIterator __p = __first; ++__p != __last;)
3164 __partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
3171 if (__first == __last)
3179 if (__first == --__last)
3181 } while (!__pred(*__last));
3182 swap(*__first, *__last);
3190 partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
3193 … (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());
3201 partition_copy(_InputIterator __first, _InputIterator __last,
3205 for (; __first != __last; ++__first)
3225 partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
3228 difference_type __len = _VSTD::distance(__first, __last);
3249 __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
3278 while (++__i != __last)
3312 // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true
3314 _ForwardIterator __second_false = __last;
3318 if (++__m1 == __last)
3324 __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __fit);
3341 __stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
3348 if (__first == __last)
3354 // We now have a reduced range [__first, __last)
3358 difference_type __len = _VSTD::distance(__first, __last);
3367 (__first, __last, __pred, __len, __p, forward_iterator_tag());
3372 __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
3376 // *__last is known to be true
3380 swap(*__first, *__last);
3381 return __last;
3389 swap(*__m, *__last);
3390 return __last;
3392 swap(*__m, *__last);
3408 while (++__i != __last)
3422 // move *__last, known to be true
3456 // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true
3458 _BidirectionalIterator __second_false = __last;
3463 if (++__m1 == __last)
3469 __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __bit);
3480 __stable_partition(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred,
3489 if (__first == __last)
3496 // Either prove [__first, __last) is all false and return __first, or point __last to last true
3499 if (__first == --__last)
3501 } while (!__pred(*__last));
3502 // We now have a reduced range [__first, __last]
3504 // *__last is known to be true
3506 difference_type __len = _VSTD::distance(__first, __last) + 1;
3515 (__first, __last, __pred, __len, __p, bidirectional_iterator_tag());
3521 stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
3524 … (__first, __last, __pred, typename iterator_traits<_ForwardIterator>::iterator_category());
3531 is_sorted_until(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
3533 if (__first != __last)
3536 while (++__i != __last)
3543 return __last;
3549 is_sorted_until(_ForwardIterator __first, _ForwardIterator __last)
3551 …return _VSTD::is_sorted_until(__first, __last, __less<typename iterator_traits<_ForwardIterator>::…
3559 is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
3561 return _VSTD::is_sorted_until(__first, __last, __comp) == __last;
3567 is_sorted(_ForwardIterator __first, _ForwardIterator __last)
3569 …return _VSTD::is_sorted(__first, __last, __less<typename iterator_traits<_ForwardIterator>::value_…
3672 __selection_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)
3674 _BirdirectionalIterator __lm1 = __last;
3679 (__first, __last, __comp);
3687 __insertion_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)
3690 if (__first != __last)
3693 for (++__i; __i != __last; ++__i)
3706 __insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
3711 for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
3731 __insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare _…
3733 switch (__last - __first)
3739 if (__comp(*--__last, *__first))
3740 swap(*__first, *__last);
3743 _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
3746 _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
3749 _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
3757 for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
3771 return ++__i == __last;
3815 __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
3825 difference_type __len = __last - __first;
3832 if (__comp(*--__last, *__first))
3833 swap(*__first, *__last);
3836 _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
3839 _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
3842 _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
3847 _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);
3852 _RandomAccessIterator __lm1 = __last;
3872 // partition [__first, __m) < *__m and *__m <= [__m, __last)
3888 // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)
3890 __j = __last;
3891 if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)
3896 return; // [__first, __last) all equivalent elements
3907 // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1
3922 // [__first, __i) == *__first and *__first < [__i, __last)
3924 // _VSTD::__sort<_Compare>(__i, __last, __comp);
3963 // [__first, __i) < *__m and *__m <= [__i, __last)
3969 // [__first, __i) < *__i and *__i <= [__i+1, __last)
3974 if (_VSTD::__insertion_sort_incomplete<_Compare>(__i+1, __last, __comp))
3978 __last = __i;
3991 if (__i - __first < __last - __i)
3994 // _VSTD::__sort<_Compare>(__i+1, __last, __comp);
3999 _VSTD::__sort<_Compare>(__i+1, __last, __comp);
4001 __last = __i;
4010 sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4015 __sort<_Comp_ref>(__first, __last, __c);
4018 __sort<_Comp_ref>(__first, __last, __comp);
4025 sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
4027 …_VSTD::sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>()…
4033 sort(_Tp** __first, _Tp** __last)
4035 _VSTD::sort((size_t*)__first, (size_t*)__last, __less<size_t>());
4041 sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last)
4043 _VSTD::sort(__first.base(), __last.base());
4049 sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last, _Compare __comp)
4052 _VSTD::sort<_Tp*, _Comp_ref>(__first.base(), __last.base(), __comp);
4093 __lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __co…
4096 difference_type __len = _VSTD::distance(__first, __last);
4116 lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
4119 return __lower_bound<_Comp_ref>(__first, __last, __value_, __comp);
4125 lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
4127 return _VSTD::lower_bound(__first, __last, __value_,
4135 __upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __co…
4138 difference_type __len = _VSTD::distance(__first, __last);
4158 upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
4161 return __upper_bound<_Comp_ref>(__first, __last, __value_, __comp);
4167 upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
4169 return _VSTD::upper_bound(__first, __last, __value_,
4177 __equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __co…
4180 difference_type __len = _VSTD::distance(__first, __last);
4193 __last = __m;
4202 __upper_bound<_Compare>(++__mp1, __last, __value_, __comp)
4212 equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
4217 return __equal_range<_Comp_ref>(__first, __last, __value_, __c);
4220 return __equal_range<_Comp_ref>(__first, __last, __value_, __comp);
4227 equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
4229 return _VSTD::equal_range(__first, __last, __value_,
4238 __binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __…
4240 __first = __lower_bound<_Compare>(__first, __last, __value_, __comp);
4241 return __first != __last && !__comp(__value_, *__first);
4247 binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __co…
4252 return __binary_search<_Comp_ref>(__first, __last, __value_, __c);
4255 return __binary_search<_Comp_ref>(__first, __last, __value_, __comp);
4262 binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
4264 return _VSTD::binary_search(__first, __last, __value_,
4352 …rge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
4365 __half_inplace_merge(__buff, __p, __middle, __last, __first, __comp);
4370 …for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), (void) ++__…
4376 _RBi(__last), __invert<_Compare>(__comp));
4382 …rge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
4390 // if __middle == __last, we're done
4395 (__first, __middle, __last, __comp, __len1, __len2, __buff);
4404 // __first < __middle < __last
4406 // partition [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last) such that
4410 // [__m1, __middle) <= [__m2, __last)
4413 _BidirectionalIterator __m2; // "median" of [__middle, __last)
4437 __m2 = __lower_bound<_Compare>(__middle, __last, *__m1, __comp);
4441 difference_type __len22 = __len2 - __len21; // distance(__m2, __last)
4442 // [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last)
4450 // __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __b…
4458 … __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
4460 __last = __middle;
4471 …rge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
4477 difference_type __len2 = _VSTD::distance(__middle, __last);
4485 return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __c, __len1, __len2,
4489 return _VSTD::__inplace_merge<_Comp_ref>(__first, __middle, __last, __comp, __len1, __len2,
4497 …rge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last)
4499 _VSTD::inplace_merge(__first, __middle, __last,
4576 __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
4634 __stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
4646 if (__comp(*--__last, *__first))
4647 swap(*__first, *__last);
4652 __insertion_sort<_Compare>(__first, __last, __comp);
4663 __stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2);
4674 __stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size);
4675 … __inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size);
4681 stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4685 difference_type __len = __last - __first;
4696 __stable_sort<_Comp_ref>(__first, __last, __c, __len, __buf.first, __buf.second);
4699 __stable_sort<_Comp_ref>(__first, __last, __comp, __len, __buf.first, __buf.second);
4706 stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
4708 …_VSTD::stable_sort(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_…
4715 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4718 difference_type __len = __last - __first;
4730 return __last;
4737 return __last;
4743 is_heap_until(_RandomAccessIterator __first, _RandomAccessIterator __last)
4745 …return _VSTD::is_heap_until(__first, __last, __less<typename iterator_traits<_RandomAccessIterator…
4753 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4755 return _VSTD::is_heap_until(__first, __last, __comp) == __last;
4761 is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
4763 …return _VSTD::is_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::val…
4770 __sift_up(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
4778 if (__comp(*__ptr, *--__last))
4780 value_type __t(_VSTD::move(*__last));
4783 *__last = _VSTD::move(*__ptr);
4784 __last = __ptr;
4790 *__last = _VSTD::move(__t);
4798 push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4803 __sift_up<_Comp_ref>(__first, __last, __c, __last - __first);
4806 __sift_up<_Comp_ref>(__first, __last, __comp, __last - __first);
4813 push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
4815 …_VSTD::push_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_ty…
4822 __sift_down(_RandomAccessIterator __first, _RandomAccessIterator /*__last*/,
4878 __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
4883 swap(*__first, *--__last);
4884 __sift_down<_Compare>(__first, __last, __comp, __len - 1, __first);
4891 pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4896 __pop_heap<_Comp_ref>(__first, __last, __c, __last - __first);
4899 __pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first);
4906 pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
4908 …_VSTD::pop_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_typ…
4915 __make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4918 difference_type __n = __last - __first;
4924 __sift_down<_Compare>(__first, __last, __comp, __n, __first + __start);
4932 make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4937 __make_heap<_Comp_ref>(__first, __last, __c);
4940 __make_heap<_Comp_ref>(__first, __last, __comp);
4947 make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
4949 …_VSTD::make_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_ty…
4956 __sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4959 for (difference_type __n = __last - __first; __n > 1; --__last, --__n)
4960 __pop_heap<_Compare>(__first, __last, __comp, __n);
4966 sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
4971 __sort_heap<_Comp_ref>(__first, __last, __c);
4974 __sort_heap<_Comp_ref>(__first, __last, __comp);
4981 sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
4983 …_VSTD::sort_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_ty…
4990 …l_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
4995 for (_RandomAccessIterator __i = __middle; __i != __last; ++__i)
5009 …l_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
5015 __partial_sort<_Comp_ref>(__first, __middle, __last, __c);
5018 __partial_sort<_Comp_ref>(__first, __middle, __last, __comp);
5025 …l_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
5027 _VSTD::partial_sort(__first, __middle, __last,
5035 __partial_sort_copy(_InputIterator __first, _InputIterator __last,
5041 for (; __first != __last && __r != __result_last; (void) ++__first, ++__r)
5045 for (; __first != __last; ++__first)
5059 partial_sort_copy(_InputIterator __first, _InputIterator __last,
5065 return __partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __c);
5068 return __partial_sort_copy<_Comp_ref>(__first, __last, __result_first, __result_last, __comp);
5075 partial_sort_copy(_InputIterator __first, _InputIterator __last,
5078 return _VSTD::partial_sort_copy(__first, __last, __result_first, __result_last,
5086 …AccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)
5094 if (__nth == __last)
5096 difference_type __len = __last - __first;
5103 if (__comp(*--__last, *__first))
5104 swap(*__first, *__last);
5109 _VSTD::__sort3<_Compare>(__first, ++__m, --__last, __comp);
5115 __selection_sort<_Compare>(__first, __last, __comp);
5120 _RandomAccessIterator __lm1 = __last;
5123 // partition [__first, __m) < *__m and *__m <= [__m, __last)
5139 // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)
5141 __j = __last;
5142 if (!__comp(*__first, *--__j)) // we need a guard if *__first == *(__last-1)
5147 return; // [__first, __last) all equivalent elements
5158 // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1
5173 // [__first, __i) == *__first and *__first < [__i, __last)
5178 // __nth_element<_Compare>(__i, __nth, __last, __comp);
5215 // [__first, __i) < *__m and *__m <= [__i, __last)
5221 // [__first, __i) < *__i and *__i <= [__i+1, __last)
5243 // Check for [__i, __last) already sorted
5245 while (++__j != __last)
5252 // [__i, __last) sorted
5261 __last = __i;
5265 // __nth_element<_Compare>(__i+1, __nth, __last, __comp);
5274 …AccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp)
5279 __nth_element<_Comp_ref>(__first, __nth, __last, __c);
5282 __nth_element<_Comp_ref>(__first, __nth, __last, __comp);
5289 …h_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last)
5291 …_VSTD::nth_element(__first, __nth, __last, __less<typename iterator_traits<_RandomAccessIterator>:…
5604 __next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
5606 _BidirectionalIterator __i = __last;
5607 if (__first == __last || __first == --__i)
5614 _BidirectionalIterator __j = __last;
5618 _VSTD::reverse(__ip1, __last);
5623 _VSTD::reverse(__first, __last);
5632 next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
5637 return __next_permutation<_Comp_ref>(__first, __last, __c);
5640 return __next_permutation<_Comp_ref>(__first, __last, __comp);
5647 next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
5649 return _VSTD::next_permutation(__first, __last,
5657 __prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
5659 _BidirectionalIterator __i = __last;
5660 if (__first == __last || __first == --__i)
5667 _BidirectionalIterator __j = __last;
5671 _VSTD::reverse(__ip1, __last);
5676 _VSTD::reverse(__first, __last);
5685 prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp)
5690 return __prev_permutation<_Comp_ref>(__first, __last, __c);
5693 return __prev_permutation<_Comp_ref>(__first, __last, __comp);
5700 prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last)
5702 return _VSTD::prev_permutation(__first, __last,