This calls the removed element's destructor.
This member function effectively calls the pop_heap algorithm to keep the heap property of priority_queues and then calls the member function pop_back of the underlying container object to remove the element.
Parameters
noneReturn value
noneExample
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Output:
Popping out elements... 100 40 30 25 |
Complexity
Constant (in the priority_queue). Although notice that pop_heap operates on logarithmic time.See also
| priority_queue::push | Insert element (public member function) |
| priority_queue::empty | Test whether container is empty (public member function) |
