Namespaces
Variants
Views
Actions

std::priority_queue::top

From cppreference.com
< cpp‎ | container‎ | priority queue
Revision as of 12:39, 2 November 2012 by P12bot (Talk | contribs)

const_reference top() const;

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

Contents

Parameters

(none)

Return value

Reference to the top element as if obtained by a call to c.back() (since C++11)

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

Complexity

Constant.

See also

Template:cpp/container/dcl list pop