tmp/tmpuah7j9s5/{from.md → to.md}
RENAMED
|
@@ -22,24 +22,31 @@ namespace std {
|
|
| 22 |
|
| 23 |
public:
|
| 24 |
queue() : queue(Container()) {}
|
| 25 |
explicit queue(const Container&);
|
| 26 |
explicit queue(Container&&);
|
|
|
|
|
|
|
| 27 |
template<class Alloc> explicit queue(const Alloc&);
|
| 28 |
template<class Alloc> queue(const Container&, const Alloc&);
|
| 29 |
template<class Alloc> queue(Container&&, const Alloc&);
|
| 30 |
template<class Alloc> queue(const queue&, const Alloc&);
|
| 31 |
template<class Alloc> queue(queue&&, const Alloc&);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
[[nodiscard]] bool empty() const { return c.empty(); }
|
| 34 |
size_type size() const { return c.size(); }
|
| 35 |
reference front() { return c.front(); }
|
| 36 |
const_reference front() const { return c.front(); }
|
| 37 |
reference back() { return c.back(); }
|
| 38 |
const_reference back() const { return c.back(); }
|
| 39 |
void push(const value_type& x) { c.push_back(x); }
|
| 40 |
void push(value_type&& x) { c.push_back(std::move(x)); }
|
|
|
|
| 41 |
template<class... Args>
|
| 42 |
decltype(auto) emplace(Args&&... args)
|
| 43 |
{ return c.emplace_back(std::forward<Args>(args)...); }
|
| 44 |
void pop() { c.pop_front(); }
|
| 45 |
void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>)
|
|
@@ -47,15 +54,27 @@ namespace std {
|
|
| 47 |
};
|
| 48 |
|
| 49 |
template<class Container>
|
| 50 |
queue(Container) -> queue<typename Container::value_type, Container>;
|
| 51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
template<class Container, class Allocator>
|
| 53 |
queue(Container, Allocator) -> queue<typename Container::value_type, Container>;
|
| 54 |
|
| 55 |
-
template<class
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
template<class T, class Container, class Alloc>
|
| 59 |
struct uses_allocator<queue<T, Container>, Alloc>
|
| 60 |
: uses_allocator<Container, Alloc>::type { };
|
| 61 |
}
|
|
@@ -73,10 +92,26 @@ explicit queue(const Container& cont);
|
|
| 73 |
explicit queue(Container&& cont);
|
| 74 |
```
|
| 75 |
|
| 76 |
*Effects:* Initializes `c` with `std::move(cont)`.
|
| 77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
#### Constructors with allocators <a id="queue.cons.alloc">[[queue.cons.alloc]]</a>
|
| 79 |
|
| 80 |
If `uses_allocator_v<container_type, Alloc>` is `false` the constructors
|
| 81 |
in this subclause shall not participate in overload resolution.
|
| 82 |
|
|
@@ -112,10 +147,36 @@ template<class Alloc> queue(queue&& q, const Alloc& a);
|
|
| 112 |
```
|
| 113 |
|
| 114 |
*Effects:* Initializes `c` with `std::move(q.c)` as the first argument
|
| 115 |
and `a` as the second argument.
|
| 116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
#### Operators <a id="queue.ops">[[queue.ops]]</a>
|
| 118 |
|
| 119 |
``` cpp
|
| 120 |
template<class T, class Container>
|
| 121 |
bool operator==(const queue<T, Container>& x, const queue<T, Container>& y);
|
|
|
|
| 22 |
|
| 23 |
public:
|
| 24 |
queue() : queue(Container()) {}
|
| 25 |
explicit queue(const Container&);
|
| 26 |
explicit queue(Container&&);
|
| 27 |
+
template<class InputIterator> queue(InputIterator first, InputIterator last);
|
| 28 |
+
template<container-compatible-range<T> R> queue(from_range_t, R&& rg);
|
| 29 |
template<class Alloc> explicit queue(const Alloc&);
|
| 30 |
template<class Alloc> queue(const Container&, const Alloc&);
|
| 31 |
template<class Alloc> queue(Container&&, const Alloc&);
|
| 32 |
template<class Alloc> queue(const queue&, const Alloc&);
|
| 33 |
template<class Alloc> queue(queue&&, const Alloc&);
|
| 34 |
+
template<class InputIterator, class Alloc>
|
| 35 |
+
queue(InputIterator first, InputIterator last, const Alloc&);
|
| 36 |
+
template<container-compatible-range<T> R, class Alloc>
|
| 37 |
+
queue(from_range_t, R&& rg, const Alloc&);
|
| 38 |
|
| 39 |
[[nodiscard]] bool empty() const { return c.empty(); }
|
| 40 |
size_type size() const { return c.size(); }
|
| 41 |
reference front() { return c.front(); }
|
| 42 |
const_reference front() const { return c.front(); }
|
| 43 |
reference back() { return c.back(); }
|
| 44 |
const_reference back() const { return c.back(); }
|
| 45 |
void push(const value_type& x) { c.push_back(x); }
|
| 46 |
void push(value_type&& x) { c.push_back(std::move(x)); }
|
| 47 |
+
template<container-compatible-range<T> R> void push_range(R&& rg);
|
| 48 |
template<class... Args>
|
| 49 |
decltype(auto) emplace(Args&&... args)
|
| 50 |
{ return c.emplace_back(std::forward<Args>(args)...); }
|
| 51 |
void pop() { c.pop_front(); }
|
| 52 |
void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>)
|
|
|
|
| 54 |
};
|
| 55 |
|
| 56 |
template<class Container>
|
| 57 |
queue(Container) -> queue<typename Container::value_type, Container>;
|
| 58 |
|
| 59 |
+
template<class InputIterator>
|
| 60 |
+
queue(InputIterator, InputIterator) -> queue<iter-value-type<InputIterator>>;
|
| 61 |
+
|
| 62 |
+
template<ranges::input_range R>
|
| 63 |
+
queue(from_range_t, R&&) -> queue<ranges::range_value_t<R>>;
|
| 64 |
+
|
| 65 |
template<class Container, class Allocator>
|
| 66 |
queue(Container, Allocator) -> queue<typename Container::value_type, Container>;
|
| 67 |
|
| 68 |
+
template<class InputIterator, class Allocator>
|
| 69 |
+
queue(InputIterator, InputIterator, Allocator)
|
| 70 |
+
-> queue<iter-value-type<InputIterator>, deque<iter-value-type<InputIterator>,
|
| 71 |
+
Allocator>>;
|
| 72 |
+
|
| 73 |
+
template<ranges::input_range R, class Allocator>
|
| 74 |
+
queue(from_range_t, R&&, Allocator)
|
| 75 |
+
-> queue<ranges::range_value_t<R>, deque<ranges::range_value_t<R>, Allocator>>;
|
| 76 |
|
| 77 |
template<class T, class Container, class Alloc>
|
| 78 |
struct uses_allocator<queue<T, Container>, Alloc>
|
| 79 |
: uses_allocator<Container, Alloc>::type { };
|
| 80 |
}
|
|
|
|
| 92 |
explicit queue(Container&& cont);
|
| 93 |
```
|
| 94 |
|
| 95 |
*Effects:* Initializes `c` with `std::move(cont)`.
|
| 96 |
|
| 97 |
+
``` cpp
|
| 98 |
+
template<class InputIterator>
|
| 99 |
+
queue(InputIterator first, InputIterator last);
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
*Effects:* Initializes `c` with `first` as the first argument and `last`
|
| 103 |
+
as the second argument.
|
| 104 |
+
|
| 105 |
+
``` cpp
|
| 106 |
+
template<container-compatible-range<T> R>
|
| 107 |
+
queue(from_range_t, R&& rg);
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
*Effects:* Initializes `c` with
|
| 111 |
+
`ranges::to<Container>(std::forward<R>(rg))`.
|
| 112 |
+
|
| 113 |
#### Constructors with allocators <a id="queue.cons.alloc">[[queue.cons.alloc]]</a>
|
| 114 |
|
| 115 |
If `uses_allocator_v<container_type, Alloc>` is `false` the constructors
|
| 116 |
in this subclause shall not participate in overload resolution.
|
| 117 |
|
|
|
|
| 147 |
```
|
| 148 |
|
| 149 |
*Effects:* Initializes `c` with `std::move(q.c)` as the first argument
|
| 150 |
and `a` as the second argument.
|
| 151 |
|
| 152 |
+
``` cpp
|
| 153 |
+
template<class InputIterator, class Alloc>
|
| 154 |
+
queue(InputIterator first, InputIterator last, const Alloc& alloc);
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
*Effects:* Initializes `c` with `first` as the first argument, `last` as
|
| 158 |
+
the second argument, and `alloc` as the third argument.
|
| 159 |
+
|
| 160 |
+
``` cpp
|
| 161 |
+
template<container-compatible-range<T> R, class Alloc>
|
| 162 |
+
queue(from_range_t, R&& rg, const Alloc& a);
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
*Effects:* Initializes `c` with
|
| 166 |
+
`ranges::to<Container>(std::forward<R>(rg), a)`.
|
| 167 |
+
|
| 168 |
+
#### Modifiers <a id="queue.mod">[[queue.mod]]</a>
|
| 169 |
+
|
| 170 |
+
``` cpp
|
| 171 |
+
template<container-compatible-range<T> R>
|
| 172 |
+
void push_range(R&& rg);
|
| 173 |
+
```
|
| 174 |
+
|
| 175 |
+
*Effects:* Equivalent to `c.append_range(std::forward<R>(rg))` if that
|
| 176 |
+
is a valid expression, otherwise `ranges::copy(rg, back_inserter(c))`.
|
| 177 |
+
|
| 178 |
#### Operators <a id="queue.ops">[[queue.ops]]</a>
|
| 179 |
|
| 180 |
``` cpp
|
| 181 |
template<class T, class Container>
|
| 182 |
bool operator==(const queue<T, Container>& x, const queue<T, Container>& y);
|