const value_type& top() const;
const_reference top() const;
12345678910111213141516
// priority_queue::top #include <iostream> // std::cout #include <queue> // std::priority_queue int main () { std::priority_queue<int> mypq; mypq.push(10); mypq.push(20); mypq.push(15); std::cout << "mypq.top() is now " << mypq.top() << '\n'; return 0; }
mypq.top() is now 20