48template <
class _RandomAccessIter,
class _Dist,
class _TypeT,
class _Compare>
49void __push_heap (_RandomAccessIter __first, _Dist __holeIndex,
50 _Dist __topIndex, _TypeT __val, _Compare __comp)
52 for (_Dist __parent = (__holeIndex - 1) / 2;
53 __holeIndex > __topIndex
54 && !(__comp (*(__first + __parent), __val) ==
false);
55 __parent = ((__holeIndex = __parent) - 1) / 2) {
56 *(__first + __holeIndex) = *(__first + __parent);
59 *(__first + __holeIndex) = __val;
64template <
class _RandomAccessIter,
class _Dist,
class _TypeT,
class _Compare>
65void __adjust_heap (_RandomAccessIter __first, _Dist __holeIndex,
66 _Dist __dist, _TypeT __val, _Compare __comp)
68 const _Dist __topIndex = __holeIndex;
72 while ((__2ndChild = 2 * __holeIndex + 2) < __dist) {
73 if (__comp (*(__first + __2ndChild), *(__first + (__2ndChild - 1))))
76 *(__first + __holeIndex) = *(__first + __2ndChild);
77 __holeIndex = __2ndChild;
80 if (__2ndChild == __dist) {
81 *(__first + __holeIndex) = *(__first + (__2ndChild - 1));
82 __holeIndex = __2ndChild - 1;
85 __push_heap (__first, __holeIndex, __topIndex, __val, __comp);
90template <
class _RandomAccessIter,
class _Compare,
class _Dist>
91void __make_heap (_RandomAccessIter __first, _RandomAccessIter __last,
92 _Compare __comp, _Dist*)
96 const _Dist __dist = __last - __first;
98 for (_Dist __parent = __dist / 2; 0 < __parent; ) {
100 __adjust_heap (__first, __parent, __dist, *(__first + __parent),
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_ASSERT_RANGE(ign1, ign2)