cppreference.com -> C++ Priority Queues -> Details

C++ Priority Queues


empty

Syntax:

  bool empty();

The empty() function returns true if the current priority queue is empty, and false otherwise.


pop

Syntax:

  void pop();

The function pop() discards the first element in the current priority queue.


push

Syntax:

  void push( const TYPE &val );

The function push() adds an element to the current priority queue.


size

Syntax:

  size_type size();

The size() function returns the number of things in the current priority queue.


top

Syntax:

   TYPE &top();

The top() function returns a reference to the element in the queue with the highest priority. Note that only pop() removes an element.