std::priority_queue::top

std::priority_queue::top

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
(public member function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/container/priority_queue/top

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部