Parameter Description Default
T The type of object stored in the priority queue.
Sequence The type of the underlying container used to implement the priority queue. vector<T>
Compare The comparison function used to determine whether one element is smaller than another element. If Compare(x,y) is true, then x is smaller than y. The element returned by Q.top() is the largest element in the priority queue. That is, it has the property that, for every other element x in the priority queue, Compare(Q.top(), x) is false. less<T>
Model of

Assignable, Default Constructible

Type requirements

• T is a model of Assignable.

• Sequence is a model of Sequence.

• Sequence is a model of Random Access Container.

• Sequence::value_type is the same type as T.

• Compare is a model of Binary Predicate.

• Compare induces a strict weak ordering, as defined in the LessThan Comparable requirements, on its argument type.

• T is convertible to Compare's argument type.

Public base classes

None.

Members
Member Where defined Description
value_type priority_queue See below.
size_type priority_queue See below.
priority_queue() Default Constructible The default constructor. Creates an empty priority_queue, using Compare() as the comparison function.
priority_queue(const priority_queue&) Assignable The copy constructor.
priority_queue(const Compare&) priority_queue See below.
priority_queue(const value_type*, const value_type*) priority_queue See below.
priority_queue(const value_type*, const value_type*, const Compare&) priority_queue See below.
priority_queue& operator=(const priority_queue&) Assignable The assignment operator.
bool empty() const priority_queue See below.
size_type size() const priority_queue See below.
Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату