Files
cppdraft_translate/cppdraft/priqueue/members.md
2025-10-25 03:02:53 +03:00

2.2 KiB
Raw Blame History

[priqueue.members]

23 Containers library [containers]

23.6 Container adaptors [container.adaptors]

23.6.4 Class template priority_queue [priority.queue]

23.6.4.4 Members [priqueue.members]

🔗

constexpr void push(const value_type& x);

1

#

Effects: As if by:c.push_back(x); push_heap(c.begin(), c.end(), comp);

🔗

constexpr void push(value_type&& x);

2

#

Effects: As if by:c.push_back(std::move(x)); push_heap(c.begin(), c.end(), comp);

🔗

template<[container-compatible-range](container.intro.reqmts#concept:container-compatible-range "23.2.2.1Introduction[container.intro.reqmts]")<T> R> constexpr void push_range(R&& rg);

3

#

Effects: Inserts all elements of rg in c viac.append_range(std::forward(rg)) if that is a valid expression, orranges::copy(rg, back_inserter(c)) otherwise.

Then restores the heap property as if bymake_heap(c.begin(), c.end(), comp).

4

#

Postconditions: is_heap(c.begin(), c.end(), comp) is true.

🔗

template<class... Args> constexpr void emplace(Args&&... args);

5

#

Effects: As if by:c.emplace_back(std::forward(args)...); push_heap(c.begin(), c.end(), comp);

🔗

constexpr void pop();

6

#

Effects: As if by:pop_heap(c.begin(), c.end(), comp); c.pop_back();