29#if !defined (_STLP_INTERNAL_ALGO_H)
33#ifndef _STLP_INTERNAL_TEMPBUF_H
41template <
class _B
idirectionalIter,
class _Distance,
class _Compare>
43 _BidirectionalIter __middle,
45 _Distance __len1, _Distance __len2,
49template <
class _BidirectionalIter1,
class _BidirectionalIter2,
50 class _BidirectionalIter3,
class _Compare>
52 _BidirectionalIter1 __last1,
53 _BidirectionalIter2 __first2,
54 _BidirectionalIter2 __last2,
55 _BidirectionalIter3 __result,
59#if !(defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x420 ))
62const _Tp&
__median(
const _Tp& __a,
const _Tp& __b,
const _Tp&
__c) {
78template <
class _Tp,
class _Compare>
79#if !(defined (__SUNPRO_CC) && (__SUNPRO_CC < 0x420 ))
83__median(
const _Tp& __a,
const _Tp& __b,
const _Tp&
__c, _Compare __comp) {
84 if (__comp(__a, __b)) {
86 if (__comp(__b,
__c)) {
90 else if (__comp(__a,
__c)) {
97 else if (__comp(__a,
__c)) {
101 else if (__comp(__b,
__c)) {
111template <
class _ForwardIter1,
class _ForwardIter2>
112_ForwardIter1
search(_ForwardIter1 __first1, _ForwardIter1 __last1,
113 _ForwardIter2 __first2, _ForwardIter2 __last2) {
117 if (__first1 == __last1 || __first2 == __last2)
121 _ForwardIter2 __p1(__first2);
123 if ( ++__p1 == __last2 )
124 return find(__first1, __last1, *__first2);
129 __first1 =
find(__first1, __last1, *__first2);
130 if (__first1 == __last1)
133 _ForwardIter2 __p = __p1;
134 _ForwardIter1 __current = __first1;
135 if (++__current == __last1)
138 while (*__current == *__p) {
139 if (++__p == __last2)
141 if (++__current == __last1)
152template <
class _RandomAccessIter,
class _Integer,
class _Tp,
153 class _BinaryPred,
class _Distance>
155 _Integer __count,
const _Tp&
__val, _BinaryPred
__pred,
158 _Distance __tailSize =
__last - __first;
159 const _Distance __pattSize = __count;
160 const _Distance __skipOffset = __pattSize - 1;
161 _RandomAccessIter __backTrack;
162 _Distance __remainder, __prevRemainder;
164 for ( _RandomAccessIter __lookAhead = __first + __skipOffset; __tailSize >= __pattSize; __lookAhead += __pattSize ) {
166 __tailSize -= __pattSize;
169 if (__tailSize < __pattSize)
172 __lookAhead += __pattSize;
173 __tailSize -= __pattSize;
176 if ( __skipOffset == 0 ) {
177 return (__lookAhead - __skipOffset);
180 __remainder = __skipOffset;
182 for (__backTrack = __lookAhead;
__pred(*--__backTrack,
__val); ) {
183 if (--__remainder == 0)
184 return (__lookAhead - __skipOffset);
187 if (__remainder > __tailSize)
190 __lookAhead += __remainder;
191 __tailSize -= __remainder;
194 __prevRemainder = __remainder;
195 __backTrack = __lookAhead;
198 if (--__remainder == 0)
199 return (__lookAhead - __skipOffset);
203 __remainder += __pattSize - __prevRemainder;
205 if (__remainder > __tailSize)
208 __lookAhead += __remainder;
209 __tailSize -= __remainder;
218template <
class _ForwardIter,
class _Integer,
class _Tp,
219 class _Distance,
class _BinaryPred>
221 _Integer __count,
const _Tp&
__val, _BinaryPred
__pred,
224 while (__first !=
__last) {
225 _Integer
__n = __count - 1;
226 _ForwardIter __i = __first;
235 for (__first = ++__i; (__first !=
__last) && !
__pred(*__first,
__val); ++__first) {}
245template <
class _ForwardIter,
class _Integer,
class _Tp>
247 _Integer __count,
const _Tp&
__val) {
259template <
class _ForwardIter,
class _Integer,
class _Tp,
class _BinaryPred>
261 _Integer __count,
const _Tp&
__val,
262 _BinaryPred __binary_pred) {
271template <
class _ForwardIter1,
class _ForwardIter2>
273find_end(_ForwardIter1 __first1, _ForwardIter1 __last1,
274 _ForwardIter2 __first2, _ForwardIter2 __last2) {
292template <
class _InputIterator,
class _OutputIterator,
class _BinaryPredicate,
296 _OutputIterator __result,
297 _BinaryPredicate __binary_pred, _Tp*) {
298 _Tp
__val = *__first;
300 while (++__first !=
__last)
301 if (!__binary_pred(
__val, *__first)) {
308template <
class _InputIter,
class _OutputIter,
class _BinaryPredicate>
316template <
class _InputIter,
class _ForwardIter,
class _BinaryPredicate>
320 *__result = *__first;
321 while (++__first !=
__last)
322 if (!__binary_pred(*__result, *__first)) *++__result = *__first;
326#if defined (_STLP_NONTEMPL_BASE_MATCH_BUG)
327template <
class _InputIterator,
class _B
idirectionalIterator,
class _BinaryPredicate>
328inline _BidirectionalIterator
330 _BidirectionalIterator __result, _BinaryPredicate __binary_pred,
335template <
class _InputIterator,
class _RandomAccessIterator,
class _BinaryPredicate>
336inline _RandomAccessIterator
338 _RandomAccessIterator __result, _BinaryPredicate __binary_pred,
346template <
class _InputIter,
class _OutputIter>
350 if (__first ==
__last)
return __result;
356template <
class _InputIter,
class _OutputIter,
class _BinaryPredicate>
359 _BinaryPredicate __binary_pred) {
361 if (__first ==
__last)
return __result;
369template <
class _ForwardIter,
class _Distance>
371 _ForwardIter __middle,
375 if (__first == __middle)
380 _ForwardIter __first2 = __middle;
382 _STLP_STD::swap(*__first++, *__first2++);
383 if (__first == __middle)
385 }
while (__first2 !=
__last);
387 _ForwardIter __new_middle = __first;
391 while (__first2 !=
__last) {
392 _STLP_STD::swap (*__first++, *__first2++);
393 if (__first == __middle)
395 else if (__first2 ==
__last)
402template <
class _B
idirectionalIter,
class _Distance>
404 _BidirectionalIter __middle,
405 _BidirectionalIter
__last,
408 if (__first == __middle)
416 while (__first != __middle && __middle !=
__last)
417 _STLP_STD::swap(*__first++, *--
__last);
419 if (__first == __middle) {
430template <
class _Eucl
ideanRingElement>
432_EuclideanRingElement
__gcd(_EuclideanRingElement __m,
433 _EuclideanRingElement
__n) {
435 _EuclideanRingElement __t = __m %
__n;
442template <
class _RandomAccessIter,
class _Distance,
class _Tp>
444 _RandomAccessIter __middle,
446 _Distance *, _Tp *) {
449 _Distance __k = __middle - __first;
450 _Distance __l =
__n - __k;
451 _RandomAccessIter __result = __first + (
__last - __middle);
457 _STLP_STD::swap_ranges(__first, __middle, __middle);
463 for (_Distance __i = 0; __i < __d; __i++) {
464 _Tp __tmp = *__first;
465 _RandomAccessIter __p = __first;
468 for (_Distance __j = 0; __j < __l/__d; __j++) {
469 if (__p > __first + __l) {
480 for (_Distance __j = 0; __j < __k/__d - 1; __j ++) {
486 *__p = * (__p - __l);
498template <
class _RandomAccessIter,
class _Distance>
499inline _RandomAccessIter
506template <
class _ForwardIter>
518template <
class _ForwardIter>
519void rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter
__last) {
528template <
class _Distance>
530#ifdef _STLP_NO_DRAND48
533 return lrand48() %
__n;
539template <
class _RandomAccessIter>
541 _RandomAccessIter
__last) {
543 if (__first ==
__last)
return;
544 for (_RandomAccessIter __i = __first + 1; __i !=
__last; ++__i)
548template <
class _RandomAccessIter,
class _RandomNumberGenerator>
550 _RandomNumberGenerator &__rand) {
552 if (__first ==
__last)
return;
553 for (_RandomAccessIter __i = __first + 1; __i !=
__last; ++__i)
554 iter_swap(__i, __first + __rand((__i - __first) + 1));
557#if !defined (_STLP_NO_EXTENSIONS)
559template <
class _ForwardIter,
class _OutputIter,
class _Distance>
561 _OutputIter __out_ite,
const _Distance
__n) {
563 _Distance __remaining = _STLP_STD::distance(__first,
__last);
564 _Distance __m = (
min) (
__n, __remaining);
568 *__out_ite = *__first;
580template <
class _ForwardIter,
class _OutputIter,
class _Distance,
581 class _RandomNumberGenerator>
583 _OutputIter __out_ite,
const _Distance
__n,
584 _RandomNumberGenerator& __rand) {
586 _Distance __remaining = _STLP_STD::distance(__first,
__last);
587 _Distance __m = (
min) (
__n, __remaining);
590 if (__rand(__remaining) < __m) {
591 *__out_ite = *__first;
604template <
class _InputIter,
class _RandomAccessIter,
class _Distance>
606 _RandomAccessIter __out_ite,
607 const _Distance
__n) {
610 for ( ; __first !=
__last && __m <
__n; ++__m, ++__first)
611 __out_ite[__m] = *__first;
613 while (__first !=
__last) {
617 __out_ite[__M] = *__first;
621 return __out_ite + __m;
624template <
class _InputIter,
class _RandomAccessIter,
625 class _RandomNumberGenerator,
class _Distance>
627 _RandomAccessIter __out_ite,
628 _RandomNumberGenerator& __rand,
629 const _Distance
__n) {
632 for ( ; __first !=
__last && __m <
__n; ++__m, ++__first)
633 __out_ite[__m] = *__first;
635 while (__first !=
__last) {
637 _Distance __M = __rand(__t);
639 __out_ite[__M] = *__first;
643 return __out_ite + __m;
648template <
class _InputIter,
class _RandomAccessIter>
651 _RandomAccessIter __out_first, _RandomAccessIter __out_last) {
655 __out_first, __out_last - __out_first);
658template <
class _InputIter,
class _RandomAccessIter,
class _RandomNumberGenerator>
661 _RandomAccessIter __out_first, _RandomAccessIter __out_last,
662 _RandomNumberGenerator& __rand) {
667 __out_last - __out_first);
675template <
class _ForwardIter,
class _Predicate>
680 if (__first ==
__last)
return __first;
683 if (++__first ==
__last)
return __first;
685 _ForwardIter __next = __first;
687 while (++__next !=
__last) {
689 _STLP_STD::swap(*__first, *__next);
696template <
class _B
idirectionalIter,
class _Predicate>
698 _BidirectionalIter
__last,
705 else if (
__pred(*__first))
724#if defined (_STLP_NONTEMPL_BASE_MATCH_BUG)
725template <
class _B
idirectionalIter,
class _Predicate>
727_BidirectionalIter
__partition(_BidirectionalIter __first,
728 _BidirectionalIter
__last,
737template <
class _ForwardIter,
class _Predicate>
751template <
class _ForwardIter,
class _Predicate,
class _Distance>
754 _Predicate
__pred, _Distance __len,
755 bool __pred_of_first,
bool __pred_of_before_last) {
757 return (__pred_of_first && (__pred_of_before_last ||
__pred(*__first))) ?
__last : __first;
758 _ForwardIter __middle = __first;
759 _Distance __half_len = __len / 2;
760 _STLP_STD::advance(__middle, __half_len);
766template <
class _ForwardIter,
class _Pointer,
class _Predicate,
770 _Predicate
__pred, _Distance __len,
771 _Pointer __buffer, _Distance __buffer_size,
772 bool __pred_of_first,
bool __pred_of_before_last) {
773 if (__len <= __buffer_size) {
774 _ForwardIter __result1 = __first;
775 _Pointer __result2 = __buffer;
776 if ((__first !=
__last) && (!__pred_of_first ||
__pred(*__first))) {
777 *__result2 = *__first;
778 ++__result2; ++__first; --__len;
780 for (; __first !=
__last ; ++__first, --__len) {
781 if (((__len == 1) && (__pred_of_before_last ||
__pred(*__first))) ||
782 ((__len != 1) &&
__pred(*__first))){
783 *__result1 = *__first;
787 *__result2 = *__first;
791 _STLP_STD::copy(__buffer, __result2, __result1);
795 _ForwardIter __middle = __first;
796 _Distance __half_len = __len / 2;
797 _STLP_STD::advance(__middle, __half_len);
799 __half_len, __buffer, __buffer_size,
800 __pred_of_first,
false),
803 __len - __half_len, __buffer, __buffer_size,
804 true, __pred_of_before_last));
808template <
class _ForwardIter,
class _Predicate,
class _Tp,
class _Distance>
811 _Predicate
__pred, _Tp*, _Distance*,
bool __pred_of_before_last) {
814 return (__buf.
size() > 0) ?
818 false, __pred_of_before_last) :
821 false, __pred_of_before_last);
825template <
class _ForwardIter,
class _Predicate>
834template <
class _B
idirectIter,
class _Predicate>
853#if defined (_STLP_NONTEMPL_BASE_MATCH_BUG)
854template <
class _B
idirectIter,
class _Predicate>
864template <
class _ForwardIter,
class _Predicate>
871 else if (
__pred(*__first))
882template <
class _RandomAccessIter,
class _Tp,
class _Compare>
885 _Tp __pivot, _Compare __comp) {
887 while (__comp(*__first, __pivot)) {
892 while (__comp(__pivot, *
__last)) {
904#define __stl_threshold 16
906template <
class _RandomAccessIter,
class _Tp,
class _Compare>
909 _RandomAccessIter __next =
__last;
911 while (__comp(
__val, *__next)) {
920template <
class _RandomAccessIter,
class _Tp,
class _Compare>
922 _RandomAccessIter
__last, _Tp
__val, _Compare __comp) {
925 if (__comp(
__val, *__first)) {
934template <
class _RandomAccessIter,
class _Tp,
class _Compare>
937 _Tp *, _Compare __comp) {
938 if (__first ==
__last)
return;
939 for (_RandomAccessIter __i = __first + 1; __i !=
__last; ++__i)
940 __linear_insert<_RandomAccessIter, _Tp, _Compare>(__first, __i, *__i, __comp);
943template <
class _RandomAccessIter,
class _Tp,
class _Compare>
946 _Tp*, _Compare __comp) {
947 for (_RandomAccessIter __i = __first; __i !=
__last; ++__i)
948 __unguarded_linear_insert<_RandomAccessIter, _Tp, _Compare>(__i, *__i, __comp);
951template <
class _RandomAccessIter,
class _Compare>
958template <
class _RandomAccessIter,
class _Compare>
960 _RandomAccessIter
__last, _Compare __comp) {
969template <
class _RandomAccessIter,
class _Tp,
class _Size,
class _Compare>
971 _RandomAccessIter
__last, _Tp*,
972 _Size __depth_limit, _Compare __comp) {
974 if (__depth_limit == 0) {
979 _RandomAccessIter __cut =
982 *(__first + (
__last - __first)/2),
992template <
class _RandomAccessIter>
993void sort(_RandomAccessIter __first, _RandomAccessIter
__last) {
1005template <
class _RandomAccessIter,
class _Compare>
1006void sort(_RandomAccessIter __first, _RandomAccessIter
__last, _Compare __comp) {
1019template <
class _RandomAccessIter,
class _Compare>
1021 _RandomAccessIter
__last, _Compare __comp) {
1022 if (
__last - __first < 15) {
1026 _RandomAccessIter __middle = __first + (
__last - __first) / 2;
1035template <
class _RandomAccessIter1,
class _RandomAccessIter2,
1036 class _Distance,
class _Compare>
1038 _RandomAccessIter1
__last,
1039 _RandomAccessIter2 __result, _Distance __step_size,
1041 _Distance __two_step = 2 * __step_size;
1043 while (
__last - __first >= __two_step) {
1044 __result =
merge(__first, __first + __step_size,
1045 __first + __step_size, __first + __two_step,
1048 __first += __two_step;
1050 __step_size = (
min) (_Distance(
__last - __first), __step_size);
1052 merge(__first, __first + __step_size,
1053 __first + __step_size,
__last,
1060template <
class _RandomAccessIter,
class _Distance,
class _Compare>
1062 _RandomAccessIter
__last,
1063 _Distance __chunk_size, _Compare __comp) {
1064 while (
__last - __first >= __chunk_size) {
1067 __first += __chunk_size;
1072template <
class _RandomAccessIter,
class _Pointer,
class _Distance,
1075 _RandomAccessIter
__last, _Pointer __buffer,
1076 _Distance*, _Compare __comp) {
1077 _Distance __len =
__last - __first;
1078 _Pointer __buffer_last = __buffer + __len;
1083 while (__step_size < __len) {
1091template <
class _BidirectionalIter1,
class _BidirectionalIter2,
1094 _BidirectionalIter1 __middle,
1095 _BidirectionalIter1
__last,
1096 _Distance __len1, _Distance __len2,
1097 _BidirectionalIter2 __buffer,
1098 _Distance __buffer_size) {
1099 if (__len1 > __len2 && __len2 <= __buffer_size) {
1100 _BidirectionalIter2 __buffer_end = _STLP_STD::copy(__middle,
__last, __buffer);
1101 _STLP_STD::copy_backward(__first, __middle,
__last);
1102 return _STLP_STD::copy(__buffer, __buffer_end, __first);
1104 else if (__len1 <= __buffer_size) {
1105 _BidirectionalIter2 __buffer_end = _STLP_STD::copy(__first, __middle, __buffer);
1106 _STLP_STD::copy(__middle,
__last, __first);
1107 return _STLP_STD::copy_backward(__buffer, __buffer_end,
__last);
1113template <
class _BidirectionalIter,
class _Distance,
class _Pointer,
1116 _BidirectionalIter __middle,
1117 _BidirectionalIter
__last,
1118 _Distance __len1, _Distance __len2,
1119 _Pointer __buffer, _Distance __buffer_size,
1121 if (__len1 <= __len2 && __len1 <= __buffer_size) {
1122 _Pointer __buffer_end = _STLP_STD::copy(__first, __middle, __buffer);
1123 _STLP_STD::merge(__buffer, __buffer_end, __middle,
__last, __first, __comp);
1125 else if (__len2 <= __buffer_size) {
1126 _Pointer __buffer_end = _STLP_STD::copy(__middle,
__last, __buffer);
1131 _BidirectionalIter __first_cut = __first;
1132 _BidirectionalIter __second_cut = __middle;
1133 _Distance __len11 = 0;
1134 _Distance __len22 = 0;
1135 if (__len1 > __len2) {
1136 __len11 = __len1 / 2;
1137 _STLP_STD::advance(__first_cut, __len11);
1138 __second_cut = _STLP_STD::lower_bound(__middle,
__last, *__first_cut, __comp);
1139 __len22 += _STLP_STD::distance(__middle, __second_cut);
1142 __len22 = __len2 / 2;
1143 _STLP_STD::advance(__second_cut, __len22);
1144 __first_cut = _STLP_STD::upper_bound(__first, __middle, *__second_cut, __comp);
1145 __len11 += _STLP_STD::distance(__first, __first_cut);
1147 _BidirectionalIter __new_middle =
1149 __len22, __buffer, __buffer_size);
1151 __len22, __buffer, __buffer_size, __comp);
1153 __len2 - __len22, __buffer, __buffer_size, __comp);
1157template <
class _RandomAccessIter,
class _Pointer,
class _Distance,
1160 _RandomAccessIter
__last, _Pointer __buffer,
1161 _Distance __buffer_size, _Compare __comp) {
1162 _Distance __len = (
__last - __first + 1) / 2;
1163 _RandomAccessIter __middle = __first + __len;
1164 if (__len > __buffer_size) {
1177 _Distance(
__last - __middle), __buffer, __buffer_size,
1181template <
class _RandomAccessIter,
class _Tp,
class _Distance,
class _Compare>
1183 _RandomAccessIter
__last, _Tp*, _Distance*,
1186 if (
buf.begin() == 0)
1190 _Distance(
buf.size()),
1196template <
class _RandomAccessIter>
1198 _RandomAccessIter
__last) {
1206template <
class _RandomAccessIter,
class _Compare>
1208 _RandomAccessIter
__last, _Compare __comp) {
1219template <
class _RandomAccessIter,
class _Tp,
class _Compare>
1221 _RandomAccessIter
__last, _Tp*, _Compare __comp) {
1223 for (_RandomAccessIter __i = __middle; __i <
__last; ++__i) {
1224 if (__comp(*__i, *__first)) {
1226 __pop_heap(__first, __middle, __i, _Tp(*__i), __comp,
1235template <
class _RandomAccessIter>
1237 _RandomAccessIter
__last) {
1244template <
class _RandomAccessIter,
class _Compare>
1246 _RandomAccessIter
__last, _Compare __comp) {
1254template <
class _InputIter,
class _RandomAccessIter,
class _Compare,
1255 class _Distance,
class _Tp>
1258 _RandomAccessIter __result_first,
1259 _RandomAccessIter __result_last,
1260 _Compare __comp, _Distance*, _Tp*) {
1261 if (__result_first == __result_last)
return __result_last;
1262 _RandomAccessIter __result_real_last = __result_first;
1263 while(__first !=
__last && __result_real_last != __result_last) {
1264 *__result_real_last = *__first;
1265 ++__result_real_last;
1268 make_heap(__result_first, __result_real_last, __comp);
1269 while (__first !=
__last) {
1270 if (__comp(*__first, *__result_first)) {
1271 _STLP_VERBOSE_ASSERT(!__comp(*__result_first, *__first), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1273 _Distance(__result_real_last - __result_first),
1279 sort_heap(__result_first, __result_real_last, __comp);
1280 return __result_real_last;
1285template <
class _InputIter,
class _RandomAccessIter>
1288 _RandomAccessIter __result_first, _RandomAccessIter __result_last) {
1297template <
class _InputIter,
class _RandomAccessIter,
class _Compare>
1300 _RandomAccessIter __result_first,
1301 _RandomAccessIter __result_last, _Compare __comp) {
1313template <
class _RandomAccessIter,
class _Tp,
class _Compare>
1315 _RandomAccessIter
__last, _Tp*, _Compare __comp) {
1316 while (
__last - __first > 3) {
1317 _RandomAccessIter __cut =
1320 *(__first + (
__last - __first)/2),
1334template <
class _RandomAccessIter>
1336 _RandomAccessIter
__last) {
1343template <
class _RandomAccessIter,
class _Compare>
1345 _RandomAccessIter
__last, _Compare __comp) {
1354template <
class _ForwardIter,
class _Tp,
1355 class _Compare1,
class _Compare2,
class _Distance>
1357 _Compare1 __comp1, _Compare2 __comp2, _Distance*) {
1358 _Distance __len = _STLP_STD::distance(__first,
__last);
1362 __half = __len >> 1;
1363 _ForwardIter __middle = __first;
1364 _STLP_STD::advance(__middle, __half);
1365 if (__comp2(
__val, *__middle)) {
1372 __len = __len - __half - 1;
1378template <
class _ForwardIter,
class _Tp,
1379 class _Compare1,
class _Compare2,
class _Distance>
1382 _Compare1 __comp1, _Compare2 __comp2, _Distance* __dist) {
1383 _Distance __len = _STLP_STD::distance(__first,
__last);
1387 __half = __len >> 1;
1388 _ForwardIter __middle = __first;
1389 _STLP_STD::advance(__middle, __half);
1390 if (__comp1(*__middle,
__val)) {
1394 __len = __len - __half - 1;
1396 else if (__comp2(
__val, *__middle)) {
1404 if (__comp1(*__left,
__val)) {
1408 _STLP_STD::advance(__first, __len);
1418template <
class _InputIter1,
class _InputIter2,
class _OutputIter>
1419_OutputIter
merge(_InputIter1 __first1, _InputIter1 __last1,
1420 _InputIter2 __first2, _InputIter2 __last2,
1421 _OutputIter __result) {
1424 while (__first1 != __last1 && __first2 != __last2) {
1425 if (*__first2 < *__first1) {
1426 *__result = *__first2;
1430 *__result = *__first1;
1435 return _STLP_STD::copy(__first2, __last2, _STLP_STD::copy(__first1, __last1, __result));
1438template <
class _InputIter1,
class _InputIter2,
class _OutputIter,
1440_OutputIter
merge(_InputIter1 __first1, _InputIter1 __last1,
1441 _InputIter2 __first2, _InputIter2 __last2,
1442 _OutputIter __result, _Compare __comp) {
1445 while (__first1 != __last1 && __first2 != __last2) {
1446 if (__comp(*__first2, *__first1)) {
1448 *__result = *__first2;
1452 *__result = *__first1;
1457 return _STLP_STD::copy(__first2, __last2, _STLP_STD::copy(__first1, __last1, __result));
1462template <
class _B
idirectionalIter,
class _Distance,
class _Compare>
1464 _BidirectionalIter __middle,
1465 _BidirectionalIter
__last,
1466 _Distance __len1, _Distance __len2,
1468 if (__len1 == 0 || __len2 == 0)
1470 if (__len1 + __len2 == 2) {
1471 if (__comp(*__middle, *__first)) {
1477 _BidirectionalIter __first_cut = __first;
1478 _BidirectionalIter __second_cut = __middle;
1479 _Distance __len11 = 0;
1480 _Distance __len22 = 0;
1481 if (__len1 > __len2) {
1482 __len11 = __len1 / 2;
1483 _STLP_STD::advance(__first_cut, __len11);
1484 __second_cut = _STLP_STD::lower_bound(__middle,
__last, *__first_cut, __comp);
1485 __len22 += _STLP_STD::distance(__middle, __second_cut);
1488 __len22 = __len2 / 2;
1489 _STLP_STD::advance(__second_cut, __len22);
1490 __first_cut = _STLP_STD::upper_bound(__first, __middle, *__second_cut, __comp);
1491 __len11 += _STLP_STD::distance(__first, __first_cut);
1493 _BidirectionalIter __new_middle
1498 __len2 - __len22, __comp);
1501template <
class _BidirectionalIter1,
class _BidirectionalIter2,
1502 class _BidirectionalIter3,
class _Compare>
1504 _BidirectionalIter1 __last1,
1505 _BidirectionalIter2 __first2,
1506 _BidirectionalIter2 __last2,
1507 _BidirectionalIter3 __result,
1509 if (__first1 == __last1)
1511 if (__first2 == __last2)
1516 if (__comp(*__last2, *__last1)) {
1518 *--__result = *__last1;
1519 if (__first1 == __last1)
1524 *--__result = *__last2;
1525 if (__first2 == __last2)
1532template <
class _BidirectionalIter,
class _Tp,
1533 class _Distance,
class _Compare>
1535 _BidirectionalIter __middle,
1536 _BidirectionalIter
__last, _Tp*, _Distance*,
1538 _Distance __len1 = _STLP_STD::distance(__first, __middle);
1539 _Distance __len2 = _STLP_STD::distance(__middle,
__last);
1542 if (__buf.
begin() == 0)
1552template <
class _B
idirectionalIter>
1554 _BidirectionalIter __middle,
1555 _BidirectionalIter
__last) {
1558 if (__first == __middle || __middle ==
__last)
1565template <
class _B
idirectionalIter,
class _Compare>
1567 _BidirectionalIter __middle,
1568 _BidirectionalIter
__last, _Compare __comp) {
1571 if (__first == __middle || __middle ==
__last)
1580template <
class _InputIter1,
class _InputIter2,
class _Compare>
1582 _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) {
1585 while (__first1 != __last1 && __first2 != __last2)
1586 if (__comp(*__first2, *__first1)) {
1590 else if (__comp(*__first1, *__first2))
1593 ++__first1, ++__first2;
1595 return __first2 == __last2;
1600template <
class _InputIter1,
class _InputIter2,
class _Compare>
1601bool includes(_InputIter1 __first1, _InputIter1 __last1,
1602 _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) {
1606template <
class _InputIter1,
class _InputIter2>
1607bool includes(_InputIter1 __first1, _InputIter1 __last1,
1608 _InputIter2 __first2, _InputIter2 __last2) {
1615template <
class _InputIter1,
class _InputIter2,
class _OutputIter,
1618 _InputIter2 __first2, _InputIter2 __last2,
1619 _OutputIter __result, _Compare __comp) {
1622 while (__first1 != __last1 && __first2 != __last2) {
1623 if (__comp(*__first1, *__first2)) {
1625 *__result = *__first1;
1628 else if (__comp(*__first2, *__first1)) {
1630 *__result = *__first2;
1634 *__result = *__first1;
1640 return _STLP_STD::copy(__first2, __last2, _STLP_STD::copy(__first1, __last1, __result));
1645template <
class _InputIter1,
class _InputIter2,
class _OutputIter>
1646_OutputIter
set_union(_InputIter1 __first1, _InputIter1 __last1,
1647 _InputIter2 __first2, _InputIter2 __last2,
1648 _OutputIter __result) {
1653template <
class _InputIter1,
class _InputIter2,
class _OutputIter,
1655_OutputIter
set_union(_InputIter1 __first1, _InputIter1 __last1,
1656 _InputIter2 __first2, _InputIter2 __last2,
1657 _OutputIter __result, _Compare __comp) {
1663template <
class _InputIter1,
class _InputIter2,
class _OutputIter,
1666 _InputIter2 __first2, _InputIter2 __last2,
1667 _OutputIter __result, _Compare __comp) {
1670 while (__first1 != __last1 && __first2 != __last2)
1671 if (__comp(*__first1, *__first2)) {
1675 else if (__comp(*__first2, *__first1))
1678 *__result = *__first1;
1688template <
class _InputIter1,
class _InputIter2,
class _OutputIter>
1690 _InputIter2 __first2, _InputIter2 __last2,
1691 _OutputIter __result) {
1696template <
class _InputIter1,
class _InputIter2,
class _OutputIter,
1699 _InputIter2 __first2, _InputIter2 __last2,
1700 _OutputIter __result, _Compare __comp) {
1706template <
class _InputIter1,
class _InputIter2,
class _OutputIter,
1709 _InputIter2 __first2, _InputIter2 __last2,
1710 _OutputIter __result, _Compare __comp) {
1713 while (__first1 != __last1 && __first2 != __last2)
1714 if (__comp(*__first1, *__first2)) {
1716 *__result = *__first1;
1720 else if (__comp(*__first2, *__first1))
1726 return _STLP_STD::copy(__first1, __last1, __result);
1731template <
class _InputIter1,
class _InputIter2,
class _OutputIter>
1733 _InputIter2 __first2, _InputIter2 __last2,
1734 _OutputIter __result) {
1739template <
class _InputIter1,
class _InputIter2,
class _OutputIter,
1742 _InputIter2 __first2, _InputIter2 __last2,
1743 _OutputIter __result, _Compare __comp) {
1749template <
class _InputIter1,
class _InputIter2,
class _OutputIter,
class _Compare>
1752 _InputIter2 __first2, _InputIter2 __last2,
1753 _OutputIter __result, _Compare __comp) {
1756 while (__first1 != __last1 && __first2 != __last2) {
1757 if (__comp(*__first1, *__first2)) {
1759 *__result = *__first1;
1763 else if (__comp(*__first2, *__first1)) {
1764 *__result = *__first2;
1773 return _STLP_STD::copy(__first2, __last2, _STLP_STD::copy(__first1, __last1, __result));
1778template <
class _InputIter1,
class _InputIter2,
class _OutputIter>
1781 _InputIter2 __first2, _InputIter2 __last2,
1782 _OutputIter __result) {
1787template <
class _InputIter1,
class _InputIter2,
class _OutputIter,
class _Compare>
1790 _InputIter2 __first2, _InputIter2 __last2,
1791 _OutputIter __result,
1799template <
class _ForwardIter>
1802 if (__first ==
__last)
return __first;
1803 _ForwardIter __result = __first;
1804 while (++__first !=
__last)
1805 if (*__result < *__first) {
1812template <
class _ForwardIter,
class _Compare>
1816 if (__first ==
__last)
return __first;
1817 _ForwardIter __result = __first;
1818 while (++__first !=
__last) {
1819 if (__comp(*__result, *__first)) {
1827template <
class _ForwardIter>
1830 if (__first ==
__last)
return __first;
1831 _ForwardIter __result = __first;
1832 while (++__first !=
__last)
1833 if (*__first < *__result) {
1840template <
class _ForwardIter,
class _Compare>
1844 if (__first ==
__last)
return __first;
1845 _ForwardIter __result = __first;
1846 while (++__first !=
__last) {
1847 if (__comp(*__first, *__result)) {
1859template <
class _B
idirectionalIter,
class _Compare>
1865 _BidirectionalIter __i = __first;
1873 _BidirectionalIter __ii = __i;
1875 if (__comp(*__i, *__ii)) {
1877 _BidirectionalIter __j =
__last;
1878 while (!__comp(*__i, *--__j)) {}
1883 if (__i == __first) {
1888#if defined (_STLP_NEED_UNREACHABLE_RETURN)
1895template <
class _B
idirectionalIter>
1902template <
class _B
idirectionalIter,
class _Compare>
1911template <
class _B
idirectionalIter,
class _Compare>
1916 _BidirectionalIter __i = __first;
1924 _BidirectionalIter __ii = __i;
1926 if (__comp(*__ii, *__i)) {
1928 _BidirectionalIter __j =
__last;
1929 while (!__comp(*--__j, *__i)) {}
1934 if (__i == __first) {
1939#if defined (_STLP_NEED_UNREACHABLE_RETURN)
1946template <
class _B
idirectionalIter>
1953template <
class _B
idirectionalIter,
class _Compare>
1960#if !defined (_STLP_NO_EXTENSIONS)
1967template <
class _RandomAccessIter,
class _Distance,
class _StrictWeakOrdering>
1968bool __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp,
1970 _Distance __parent = 0;
1971 for (_Distance __child = 1; __child <
__n; ++__child) {
1972 if (__comp(__first[__parent], __first[__child])) {
1973 _STLP_VERBOSE_ASSERT(!__comp(__first[__child], __first[__parent]), _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
1976 if ((__child & 1) == 0)
1984template <
class _RandomAccessIter>
1990template <
class _RandomAccessIter,
class _StrictWeakOrdering>
1992 _StrictWeakOrdering __comp) {
2000template <
class _ForwardIter,
class _StrictWeakOrdering>
2002 _StrictWeakOrdering __comp) {
2007 _ForwardIter __next = __first;
2008 for (++__next; __next !=
__last; __first = __next, ++__next) {
2009 if (__comp(*__next, *__first)) {
2023#undef __stl_threshold
#define bidirectional_iterator_tag
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
_STLP_MOVE_TO_PRIV_NAMESPACE _Distance __random_number(_Distance __n)
void __merge_adaptive(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Pointer __buffer, _Distance __buffer_size, _Compare __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val, _Compare1 __comp1, _Compare2 __comp2, _Distance *)
void __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
_STLP_MOVE_TO_STD_NAMESPACE void rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
void __stable_sort_adaptive(_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance __buffer_size, _Compare __comp)
void __unguarded_insertion_sort_aux(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Compare __comp)
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter unique_copy(_InputIter __first, _InputIter __last, _OutputIter __result)
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last, _OutputIter __out_ite, const _Distance __n)
_STLP_MOVE_TO_STD_NAMESPACE bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last)
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _OutputIterator __unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __binary_pred, _Tp *)
_STLP_MOVE_TO_STD_NAMESPACE bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last)
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
void __linear_insert(_RandomAccessIter __first, _RandomAccessIter __last, _Tp __val, _Compare __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE bool __is_sorted(_ForwardIter __first, _ForwardIter __last, _StrictWeakOrdering __comp)
_STLP_MOVE_TO_STD_NAMESPACE void sort(_RandomAccessIter __first, _RandomAccessIter __last)
void __chunk_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Distance __chunk_size, _Compare __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE bool __includes(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _Compare __comp)
void __inplace_merge_aux(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Tp *, _Distance *, _Compare __comp)
_BidirectionalIter1 __rotate_adaptive(_BidirectionalIter1 __first, _BidirectionalIter1 __middle, _BidirectionalIter1 __last, _Distance __len1, _Distance __len2, _BidirectionalIter2 __buffer, _Distance __buffer_size)
_STLP_MOVE_TO_PRIV_NAMESPACE void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last, _Tp *, _Compare __comp)
void __merge_sort_loop(_RandomAccessIter1 __first, _RandomAccessIter1 __last, _RandomAccessIter2 __result, _Distance __step_size, _Compare __comp)
_STLP_MOVE_TO_STD_NAMESPACE void stable_sort(_RandomAccessIter __first, _RandomAccessIter __last)
_ForwardIter __stable_partition_aux(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, const forward_iterator_tag &)
_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, _BidirectionalIter3 __result, _Compare __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_union(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __rotate_aux(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last, _Distance *, const forward_iterator_tag &)
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
_STLP_MOVE_TO_PRIV_NAMESPACE bool __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp, _Distance __n)
_ForwardIter1 find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2)
_ForwardIter __rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last)
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP _ForwardIter __partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, const forward_iterator_tag &)
_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last)
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_intersection(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
_STLP_INLINE_LOOP _EuclideanRingElement __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
pair< _ForwardIter, _ForwardIter > __equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp &__val, _Compare1 __comp1, _Compare2 __comp2, _Distance *__dist)
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last)
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __partial_sort_copy(_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last, _Compare __comp, _Distance *, _Tp *)
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred)
_STLP_MOVE_TO_PRIV_NAMESPACE bool __next_permutation(_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp)
_STLP_MOVE_TO_STD_NAMESPACE void partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, _RandomAccessIter __last)
_STLP_MOVE_TO_STD_NAMESPACE _RandomAccessIter random_sample(_InputIter __first, _InputIter __last, _RandomAccessIter __out_first, _RandomAccessIter __out_last)
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __inplace_stable_partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Distance __len, bool __pred_of_first, bool __pred_of_before_last)
const int __stl_chunk_size
void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val, _Compare __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE void __inplace_stable_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter stable_partition(_ForwardIter __first, _ForwardIter __last, _Predicate __pred)
void __introsort_loop(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Size __depth_limit, _Compare __comp)
void __merge_sort_with_buffer(_RandomAccessIter __first, _RandomAccessIter __last, _Pointer __buffer, _Distance *, _Compare __comp)
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2)
void __unguarded_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp)
void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Compare __comp)
_STLP_MOVE_TO_STD_NAMESPACE void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last)
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter merge(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result)
_ForwardIter __stable_partition_aux_aux(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Tp *, _Distance *, bool __pred_of_before_last)
_STLP_MOVE_TO_STD_NAMESPACE void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last)
void __stable_sort_aux(_RandomAccessIter __first, _RandomAccessIter __last, _Tp *, _Distance *, _Compare __comp)
_STLP_MOVE_TO_STD_NAMESPACE void inplace_merge(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last)
const _Tp & __median(const _Tp &__a, const _Tp &__b, const _Tp &__c)
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE void __merge_without_buffer(_BidirectionalIter __first, _BidirectionalIter __middle, _BidirectionalIter __last, _Distance __len1, _Distance __len2, _Compare __comp)
_STLP_MOVE_TO_STD_NAMESPACE bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last)
_ForwardIter __stable_partition_adaptive(_ForwardIter __first, _ForwardIter __last, _Predicate __pred, _Distance __len, _Pointer __buffer, _Distance __buffer_size, bool __pred_of_first, bool __pred_of_before_last)
_STLP_MOVE_TO_PRIV_NAMESPACE _OutputIter __set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2, _InputIter2 __last2, _OutputIter __result, _Compare __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, _RandomAccessIter __last, _Tp *, _Compare __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __random_sample(_InputIter __first, _InputIter __last, _RandomAccessIter __out_ite, const _Distance __n)
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __unguarded_partition(_RandomAccessIter __first, _RandomAccessIter __last, _Tp __pivot, _Compare __comp)
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter search_n(_ForwardIter __first, _ForwardIter __last, _Integer __count, const _Tp &__val)
_STLP_MOVE_TO_STD_NAMESPACE _RandomAccessIter partial_sort_copy(_InputIter __first, _InputIter __last, _RandomAccessIter __result_first, _RandomAccessIter __result_last)
_STLP_MOVE_TO_PRIV_NAMESPACE bool __prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last, _Compare __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE _RandomAccessIter __search_n(_RandomAccessIter __first, _RandomAccessIter __last, _Integer __count, const _Tp &__val, _BinaryPred __pred, _Distance *, const random_access_iterator_tag &)
_STLP_INLINE_LOOP _InputIter __last
_STLP_INLINE_LOOP _InputIter _Predicate __pred
_STLP_MOVE_TO_PRIV_NAMESPACE _STLP_INLINE_LOOP void __reverse(_BidirectionalIter __first, _BidirectionalIter __last, const bidirectional_iterator_tag &)
_STLP_MOVE_TO_PRIV_NAMESPACE _Size __lg(_Size __n)
_ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, _ForwardIter2 __first2, _ForwardIter2 __last2, const forward_iterator_tag &, const forward_iterator_tag &, _BinaryPredicate __comp)
_STLP_MOVE_TO_PRIV_NAMESPACE _ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp &__val, _Compare1 __comp1, _Compare2 __comp2, _Distance *)
_STLP_MOVE_TO_STD_NAMESPACE _OutputIter copy_backward(_InputIter __first, _InputIter __last, _OutputIter __result)
_STLP_MOVE_TO_STD_NAMESPACE void iter_swap(_ForwardIter1 __i1, _ForwardIter2 __i2)
_STLP_INLINE_LOOP _InputIter const _Tp & __val
#define _STLP_MPWFIX_CATCH
#define _STLP_DEBUG_CHECK(expr)
#define _STLP_VERBOSE_ASSERT(expr, diagnostic)
_STLP_MOVE_TO_PRIV_NAMESPACE less< _Tp > __less(_Tp *)
equal_to< _Tp > __equal_to(_Tp *)
void __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, _Distance __len, _Tp __val)
void make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
_STLP_INLINE_LOOP void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _RandomAccessIterator __result, _Tp __val, _Distance *)
#define _STLP_VALUE_TYPE(_It, _Tp)
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
#define _STLP_DISTANCE_TYPE(_It, _Tp)
ptrdiff_t requested_size() const
static struct loaded_include * includes
#define _STLP_CLASS_PARTIAL_SPECIALIZATION
#define _STLP_INLINE_LOOP
#define _STLP_MOVE_TO_STD_NAMESPACE
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE
GLenum GLuint GLenum GLsizei const GLchar * buf
_Check_return_ int __cdecl rand(void)
_Check_return_ _Ret_maybenull_ _In_ size_t _In_ size_t _Size
static void reverse(int *pidx, int cch)