A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://en.cppreference.com/w/cpp/language/attributes/../../container/priority_queue/empty.html below:

std::priority_queue<T,Container,Compare>::empty - cppreference.com

Checks if the underlying container has no elements. Equivalent to: return c.empty().

[edit] Parameters

(none)

[edit] Return value

true if the underlying container is empty, false otherwise.

[edit] Complexity

Constant.

[edit] Example
#include <cassert>
#include <queue>
 
int main()
{
    std::priority_queue<int> queue;
    assert(queue.empty());
 
    queue.push(42);
    assert(!queue.empty());
 
    queue.pop();
    assert(queue.empty());
}
[edit] See also returns the number of elements
(public member function) [edit] checks whether the container is empty
(function template) [edit]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4