std::priority_queue<T,Container,Compare>::top (3) - Linux Man Pages

std::priority_queue<T,Container,Compare>::top: std::priority_queue<T,Container,Compare>::top

NAME

std::priority_queue<T,Container,Compare>::top - std::priority_queue<T,Container,Compare>::top

Synopsis


const_reference top() const;


Returns reference to the top element in the priority queue. This element will be removed on a call to pop(). If default comparison function is used, the returned element is also the greatest among the elements in the queue.

Parameters


(none)

Return value


Reference to the top element as if obtained by a call to c.front()

Complexity


Constant.

See also


    removes the top element
pop (public member function)