pop_heap function template — Removes largest element from a heap
template<typename RandIter> void pop_heap(RandIter first, RandIter last); template<typename RandIter, typename Compare> void pop_heap(RandIter first, RandIter last, Compare comp);
The pop_heap
function
template copies the first (largest) element from the heap in
[first
, last
) to the end of the range, that is,
*
(last
- 1). It then ensures that the
elements remaining in [first
,
last
- 1) form a heap.
The first form compares values using the <
operator. The second form calls
comp(*iter1
, *iter2)
.