3.5 KiB
[priqueue.cons]
23 Containers library [containers]
23.6 Container adaptors [container.adaptors]
23.6.4 Class template priority_queue [priority.queue]
23.6.4.2 Constructors [priqueue.cons]
constexpr priority_queue(const Compare& x, const Container& y); constexpr priority_queue(const Compare& x, Container&& y);
Preconditions: x defines a strict weak ordering ([alg.sorting]).
Effects: Initializescomp withx andc withy (copy constructing or move constructing as appropriate); callsmake_heap(c.begin(), c.end(), comp).
template<class InputIterator> constexpr priority_queue(InputIterator first, InputIterator last, const Compare& x = Compare());
Preconditions: x defines a strict weak ordering ([alg.sorting]).
Effects: Initializes c withfirst as the first argument andlast as the second argument, and initializes comp with x; then calls make_heap(c.begin(), c.end(), comp).
template<class InputIterator> constexpr priority_queue(InputIterator first, InputIterator last, const Compare& x, const Container& y); template<class InputIterator> constexpr priority_queue(InputIterator first, InputIterator last, const Compare& x, Container&& y);
Preconditions: x defines a strict weak ordering ([alg.sorting]).
Effects: Initializescomp withx andc withy (copy constructing or move constructing as appropriate); callsc.insert(c.end(), first, last); and finally callsmake_heap(c.begin(), c.end(), comp).
template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]")<T> R> constexpr priority_queue(from_range_t, R&& rg, const Compare& x = Compare());
Preconditions: x defines a strict weak ordering ([alg.sorting]).
Effects: Initializes comp with x andc with ranges::to(std::forward(rg)) and finally calls make_heap(c.begin(), c.end(), comp).