push_heap function template — Adds a value to a heap
template<typename RandIter> void push_heap(RandIter first, RandIter last); template<typename RandIter, typename Compare> void push_heap(RandIter first, RandIter last, Compare comp);
The push_heap
function
template adds the item at last
-
1 to the heap in [first
, last
- 1), forming a new heap in the range
[first
, last
).
The first form compares values using the <
operator. The second form calls
comp(*iter1
, *iter2)
.