Standard C++ Library Reference ISO/IEC (VERSION3)

priority_queue
template<class Ty,
class Container = vector<Ty>,
class Pr = less<typename Container::value_type> >
class priority_queue {
public:
typedef Container container_type;
typedef typename Container::value_type value_type;
typedef typename Container::size_type size_type;
priority_queue();
explicit priority_queue(const Pr& pred);
priority_queue(const Pr& pred,
const container_type& cont);
priority_queue(const priority_queue& right);
template<class InIt>
priority_queue(InIt first, InIt last);
template<class InIt>
priority_queue(InIt first, InIt last,
const Pr& pred);
template<class InIt>
priority_queue(InIt first, InIt last,
const Pr& pred, const container_type& cont);
bool empty() const;
size_type size() const;
const value_type& top() const;
void push(const value_type& val);
void pop();
protected:
Container c;
Pr comp;
};
The template class describes an object that controls a varying-length sequence of elements. The
object allocates and frees storage for the sequence it controls through a protected object named
c, of class Container. The type Ty of elements in the controlled sequence must match
value_type.
The sequence is ordered using a protected object named comp. After each insertion or removal
of the top element (at position zero), for the iterators P0 and Pi designating elements at
positions 0 and I, comp(*P0, *Pi) is false. (For the default template parameter
less<typename Container::value_type> the top element of the sequence compares