PriorityQueue ‐ This class behaves like std::priority_queue and provides a few additional convenience functions.

Synopsis

Declared in <llvm/ADT/PriorityQueue.h>

template<
    class T,
    class Sequence = std::vector<T>,
    class Compare = std::less<Sequence::value_type>>
class PriorityQueue
    : public std::priority_queue<T, Sequence, Compare>

Base Classes

Name

Description

std::priority_queue<T, Sequence, Compare>

A standard container automatically sorting its contents.

Type Aliases

Name

Description

const_reference

Const reference to an element.

container_type

Underlying container type that holds the heap.

reference

Mutable reference to an element.

size_type

Unsigned type used for sizes.

value_compare

Comparator type that defines heap ordering.

value_type

Type of elements stored in the queue.

Member Functions

Name

Description

PriorityQueue [constructor]

Constructors

operator=

Assign from another priority queue.

clear

clear ‐ Erase all elements from the queue.

emplace

empty

Returns true if the %queue is empty.

erase_one

Erase one element from the queue, regardless of its position.

pop

Removes first element.

push

push overloads

push_range

reheapify

Rebuild the heap after an element's ordering relative to the comparator has changed.

size

Returns the number of elements in the %queue.

swap

top

Returns a read‐only (constant) reference to the data at the first element of the %queue.

Using Declarations

Name

Description

emplace

Construct an element in‐place and insert it into the queue.

empty

Return true if the queue contains no elements.

pop

Remove the greatest element from the queue.

push_range

Insert every element from a range into the queue.

size

Return the number of elements in the queue.

swap

Exchange contents with another priority queue.

top

Return a const reference to the greatest element.

Protected Data Members

Name

c

comp

Protected Using Declarations

Name

Description

c

Underlying container that stores the heap elements.

comp

Comparator that defines the heap ordering.

Created with MrDocs