Files
2025-10-25 03:02:53 +03:00

78 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[priqueue.members]
# 23 Containers library [[containers]](./#containers)
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#priqueue.members)
### 23.6.4 Class template priority_queue [[priority.queue]](priority.queue#priqueue.members)
#### 23.6.4.4 Members [priqueue.members]
[🔗](#lib:push,priority_queue)
`constexpr void push(const value_type& x);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16409)
*Effects*: As if by:c.push_back(x);
push_heap(c.begin(), c.end(), comp);
[🔗](#lib:push,priority_queue_)
`constexpr void push(value_type&& x);
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16424)
*Effects*: As if by:c.push_back(std::move(x));
push_heap(c.begin(), c.end(), comp);
[🔗](#lib:push_range,priority_queue)
`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](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16440)
*Effects*: Inserts all elements of rg in c viac.append_range(std::forward<R>(rg)) if that is a valid expression, orranges::copy(rg, back_inserter(c)) otherwise[.](#3.sentence-1)
Then restores the heap property as if bymake_heap(c.begin(), c.end(), comp)[.](#3.sentence-2)
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16448)
*Postconditions*: is_heap(c.begin(), c.end(), comp) is true[.](#4.sentence-1)
[🔗](#lib:emplace,priority_queue)
`template<class... Args> constexpr void emplace(Args&&... args);
`
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16459)
*Effects*: As if by:c.emplace_back(std::forward<Args>(args)...);
push_heap(c.begin(), c.end(), comp);
[🔗](#lib:pop,priority_queue)
`constexpr void pop();
`
[6](#6)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16474)
*Effects*: As if by:pop_heap(c.begin(), c.end(), comp);
c.pop_back();