Javatpoint Logo
Javatpoint Logo

C++ priority_queue empty()

C++ priority_queue empty() function is used to check whether the priority_queue container is empty or not. If priority_queue is empty, it returns true otherwise false.

Syntax

Consider priority_queue 'pq' as a priority_queue object.

Parameter

It does not take any parameter.

Return value

Null

Example 1

Output:

false

Example 2

Output:

false
true
Next TopicC++ priority_queue



Please Share

facebook twitter google plus pinterest