|
priority_queue::toppublic member function
const value_type& top ( ) const; Access top element Returns a constant reference to the top element in the priority_queue. The top element is the element that compares higher in the priority_queue, and the next that is removed from the container when priority_queue::pop is called.This member function effectively calls the member function front of the underlying container object. ParametersnoneReturn valueA reference to the top element in the priority_queue.Member type value_type is defined to the type of value contained by the underlying container, which shall be the same as the first template parameter (T). Example
Output:
ComplexityConstant.See also
|