Template Function eastl::pop_heap(RandomAccessIterator, RandomAccessIterator)¶
- Defined in File heap.h
pop_heap(RandomAccessIterator first, RandomAccessIterator last)
Removes the first item from the heap (which is an array), and adjusts the heap so that the highest priority item becomes the new first item.
Example usage: vector<int> heap;
heap.push_back(2); heap.push_back(3); heap.push_back(1); <use heap, which is the highest priority item in the heap> pop_heap(heap.begin(), heap.end()); // Moves heap to the back of the heap and adjusts the heap. heap.pop_back(); // Remove value that was just at the top of the heap