tmp/tmpbjhnvh3h/{from.md → to.md}
RENAMED
|
@@ -28,28 +28,47 @@ namespace std {
|
|
| 28 |
public:
|
| 29 |
priority_queue() : priority_queue(Compare()) {}
|
| 30 |
explicit priority_queue(const Compare& x) : priority_queue(x, Container()) {}
|
| 31 |
priority_queue(const Compare& x, const Container&);
|
| 32 |
priority_queue(const Compare& x, Container&&);
|
|
|
|
|
|
|
| 33 |
template<class InputIterator>
|
| 34 |
priority_queue(InputIterator first, InputIterator last, const Compare& x,
|
| 35 |
const Container&);
|
| 36 |
template<class InputIterator>
|
| 37 |
-
priority_queue(InputIterator first, InputIterator last,
|
| 38 |
-
|
|
|
|
|
|
|
| 39 |
template<class Alloc> explicit priority_queue(const Alloc&);
|
| 40 |
template<class Alloc> priority_queue(const Compare&, const Alloc&);
|
| 41 |
template<class Alloc> priority_queue(const Compare&, const Container&, const Alloc&);
|
| 42 |
template<class Alloc> priority_queue(const Compare&, Container&&, const Alloc&);
|
| 43 |
template<class Alloc> priority_queue(const priority_queue&, const Alloc&);
|
| 44 |
template<class Alloc> priority_queue(priority_queue&&, const Alloc&);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
[[nodiscard]] bool empty() const { return c.empty(); }
|
| 47 |
size_type size() const { return c.size(); }
|
| 48 |
const_reference top() const { return c.front(); }
|
| 49 |
void push(const value_type& x);
|
| 50 |
void push(value_type&& x);
|
|
|
|
|
|
|
| 51 |
template<class... Args> void emplace(Args&&... args);
|
| 52 |
void pop();
|
| 53 |
void swap(priority_queue& q) noexcept(is_nothrow_swappable_v<Container> &&
|
| 54 |
is_nothrow_swappable_v<Compare>)
|
| 55 |
{ using std::swap; swap(c, q.c); swap(comp, q.comp); }
|
|
@@ -58,25 +77,49 @@ namespace std {
|
|
| 58 |
template<class Compare, class Container>
|
| 59 |
priority_queue(Compare, Container)
|
| 60 |
-> priority_queue<typename Container::value_type, Container, Compare>;
|
| 61 |
|
| 62 |
template<class InputIterator,
|
| 63 |
-
class Compare = less<
|
| 64 |
-
class Container = vector<
|
| 65 |
priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container())
|
| 66 |
-
-> priority_queue<
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
template<class Compare, class Container, class Allocator>
|
| 69 |
priority_queue(Compare, Container, Allocator)
|
| 70 |
-> priority_queue<typename Container::value_type, Container, Compare>;
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
// no equality is provided
|
| 73 |
|
| 74 |
-
template<class T, class Container, class Compare>
|
| 75 |
-
void swap(priority_queue<T, Container, Compare>& x,
|
| 76 |
-
priority_queue<T, Container, Compare>& y) noexcept(noexcept(x.swap(y)));
|
| 77 |
-
|
| 78 |
template<class T, class Container, class Compare, class Alloc>
|
| 79 |
struct uses_allocator<priority_queue<T, Container, Compare>, Alloc>
|
| 80 |
: uses_allocator<Container, Alloc>::type { };
|
| 81 |
}
|
| 82 |
```
|
|
|
|
| 28 |
public:
|
| 29 |
priority_queue() : priority_queue(Compare()) {}
|
| 30 |
explicit priority_queue(const Compare& x) : priority_queue(x, Container()) {}
|
| 31 |
priority_queue(const Compare& x, const Container&);
|
| 32 |
priority_queue(const Compare& x, Container&&);
|
| 33 |
+
template<class InputIterator>
|
| 34 |
+
priority_queue(InputIterator first, InputIterator last, const Compare& x = Compare());
|
| 35 |
template<class InputIterator>
|
| 36 |
priority_queue(InputIterator first, InputIterator last, const Compare& x,
|
| 37 |
const Container&);
|
| 38 |
template<class InputIterator>
|
| 39 |
+
priority_queue(InputIterator first, InputIterator last, const Compare& x,
|
| 40 |
+
Container&&);
|
| 41 |
+
template<container-compatible-range<T> R>
|
| 42 |
+
priority_queue(from_range_t, R&& rg, const Compare& x = Compare());
|
| 43 |
template<class Alloc> explicit priority_queue(const Alloc&);
|
| 44 |
template<class Alloc> priority_queue(const Compare&, const Alloc&);
|
| 45 |
template<class Alloc> priority_queue(const Compare&, const Container&, const Alloc&);
|
| 46 |
template<class Alloc> priority_queue(const Compare&, Container&&, const Alloc&);
|
| 47 |
template<class Alloc> priority_queue(const priority_queue&, const Alloc&);
|
| 48 |
template<class Alloc> priority_queue(priority_queue&&, const Alloc&);
|
| 49 |
+
template<class InputIterator, class Alloc>
|
| 50 |
+
priority_queue(InputIterator, InputIterator, const Alloc&);
|
| 51 |
+
template<class InputIterator, class Alloc>
|
| 52 |
+
priority_queue(InputIterator, InputIterator, const Compare&, const Alloc&);
|
| 53 |
+
template<class InputIterator, class Alloc>
|
| 54 |
+
priority_queue(InputIterator, InputIterator, const Compare&, const Container&,
|
| 55 |
+
const Alloc&);
|
| 56 |
+
template<class InputIterator, class Alloc>
|
| 57 |
+
priority_queue(InputIterator, InputIterator, const Compare&, Container&&, const Alloc&);
|
| 58 |
+
template<container-compatible-range<T> R, class Alloc>
|
| 59 |
+
priority_queue(from_range_t, R&& rg, const Compare&, const Alloc&);
|
| 60 |
+
template<container-compatible-range<T> R, class Alloc>
|
| 61 |
+
priority_queue(from_range_t, R&& rg, const Alloc&);
|
| 62 |
|
| 63 |
[[nodiscard]] bool empty() const { return c.empty(); }
|
| 64 |
size_type size() const { return c.size(); }
|
| 65 |
const_reference top() const { return c.front(); }
|
| 66 |
void push(const value_type& x);
|
| 67 |
void push(value_type&& x);
|
| 68 |
+
template<container-compatible-range<T> R>
|
| 69 |
+
void push_range(R&& rg);
|
| 70 |
template<class... Args> void emplace(Args&&... args);
|
| 71 |
void pop();
|
| 72 |
void swap(priority_queue& q) noexcept(is_nothrow_swappable_v<Container> &&
|
| 73 |
is_nothrow_swappable_v<Compare>)
|
| 74 |
{ using std::swap; swap(c, q.c); swap(comp, q.comp); }
|
|
|
|
| 77 |
template<class Compare, class Container>
|
| 78 |
priority_queue(Compare, Container)
|
| 79 |
-> priority_queue<typename Container::value_type, Container, Compare>;
|
| 80 |
|
| 81 |
template<class InputIterator,
|
| 82 |
+
class Compare = less<iter-value-type<InputIterator>>,
|
| 83 |
+
class Container = vector<iter-value-type<InputIterator>>>
|
| 84 |
priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container())
|
| 85 |
+
-> priority_queue<iter-value-type<InputIterator>, Container, Compare>;
|
| 86 |
+
|
| 87 |
+
template<ranges::input_range R, class Compare = less<ranges::range_value_t<R>>>
|
| 88 |
+
priority_queue(from_range_t, R&&, Compare = Compare())
|
| 89 |
+
-> priority_queue<ranges::range_value_t<R>, vector<ranges::range_value_t<R>>, Compare>;
|
| 90 |
|
| 91 |
template<class Compare, class Container, class Allocator>
|
| 92 |
priority_queue(Compare, Container, Allocator)
|
| 93 |
-> priority_queue<typename Container::value_type, Container, Compare>;
|
| 94 |
|
| 95 |
+
template<class InputIterator, class Allocator>
|
| 96 |
+
priority_queue(InputIterator, InputIterator, Allocator)
|
| 97 |
+
-> priority_queue<iter-value-type<InputIterator>,
|
| 98 |
+
vector<iter-value-type<InputIterator>, Allocator>,
|
| 99 |
+
less<iter-value-type<InputIterator>>>;
|
| 100 |
+
|
| 101 |
+
template<class InputIterator, class Compare, class Allocator>
|
| 102 |
+
priority_queue(InputIterator, InputIterator, Compare, Allocator)
|
| 103 |
+
-> priority_queue<iter-value-type<InputIterator>,
|
| 104 |
+
vector<iter-value-type<InputIterator>, Allocator>, Compare>;
|
| 105 |
+
|
| 106 |
+
template<class InputIterator, class Compare, class Container, class Allocator>
|
| 107 |
+
priority_queue(InputIterator, InputIterator, Compare, Container, Allocator)
|
| 108 |
+
-> priority_queue<typename Container::value_type, Container, Compare>;
|
| 109 |
+
|
| 110 |
+
template<ranges::input_range R, class Compare, class Allocator>
|
| 111 |
+
priority_queue(from_range_t, R&&, Compare, Allocator)
|
| 112 |
+
-> priority_queue<ranges::range_value_t<R>, vector<ranges::range_value_t<R>, Allocator>,
|
| 113 |
+
Compare>;
|
| 114 |
+
|
| 115 |
+
template<ranges::input_range R, class Allocator>
|
| 116 |
+
priority_queue(from_range_t, R&&, Allocator)
|
| 117 |
+
-> priority_queue<ranges::range_value_t<R>, vector<ranges::range_value_t<R>, Allocator>>;
|
| 118 |
+
|
| 119 |
// no equality is provided
|
| 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
template<class T, class Container, class Compare, class Alloc>
|
| 122 |
struct uses_allocator<priority_queue<T, Container, Compare>, Alloc>
|
| 123 |
: uses_allocator<Container, Alloc>::type { };
|
| 124 |
}
|
| 125 |
```
|