const value_type& top() const | priority_queue | See below. |
void push(const value_type&) | priority_queue | See below. |
void pop() [3] | priority_queue | See below. |
These members are not defined in the Assignable and Default Constructible requirements, but are specific to
| Member | Description |
|---|---|
value_type | The type of object stored in the |
size_type | An unsigned integral type. This is the same as |
priority_queue(const Compare& comp) | The constructor. Creates an empty |
priority_queue(const value_type* first, const value_type* last) | The constructor. Creates a |
priority_queue(const value_type* first, const value_type* last, const Compare& comp) | The constructor. Creates a |
bool empty() const | Returns |
size_type size() const | Returns the number of elements contained in the |
const value_type& top() const | Returns a const reference to the element at the top of the priority_queue. The element at the top is guaranteed to be the largest element in the priority queue, as determined by the comparison function |
void push(const value_type& x) | Inserts |
void pop() | Removes the element at the top of the priority_queue, that is, the largest element in the priority_queue. [3] Precondition: |
[1] Priority queues are a standard concept, and can be implemented in many different ways; this implementation uses heaps. Priority queues are discussed in all algorithm books; see, for example, section 5.2.3 of Knuth. (D. E. Knuth,
[2] This restriction is the only reason for
