tmp/tmp26t6vmlp/{from.md → to.md}
RENAMED
|
@@ -16,22 +16,30 @@ namespace std {
|
|
| 16 |
|
| 17 |
public:
|
| 18 |
stack() : stack(Container()) {}
|
| 19 |
explicit stack(const Container&);
|
| 20 |
explicit stack(Container&&);
|
|
|
|
|
|
|
| 21 |
template<class Alloc> explicit stack(const Alloc&);
|
| 22 |
template<class Alloc> stack(const Container&, const Alloc&);
|
| 23 |
template<class Alloc> stack(Container&&, const Alloc&);
|
| 24 |
template<class Alloc> stack(const stack&, const Alloc&);
|
| 25 |
template<class Alloc> stack(stack&&, const Alloc&);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
[[nodiscard]] bool empty() const { return c.empty(); }
|
| 28 |
size_type size() const { return c.size(); }
|
| 29 |
reference top() { return c.back(); }
|
| 30 |
const_reference top() const { return c.back(); }
|
| 31 |
void push(const value_type& x) { c.push_back(x); }
|
| 32 |
void push(value_type&& x) { c.push_back(std::move(x)); }
|
|
|
|
|
|
|
| 33 |
template<class... Args>
|
| 34 |
decltype(auto) emplace(Args&&... args)
|
| 35 |
{ return c.emplace_back(std::forward<Args>(args)...); }
|
| 36 |
void pop() { c.pop_back(); }
|
| 37 |
void swap(stack& s) noexcept(is_nothrow_swappable_v<Container>)
|
|
@@ -39,13 +47,28 @@ namespace std {
|
|
| 39 |
};
|
| 40 |
|
| 41 |
template<class Container>
|
| 42 |
stack(Container) -> stack<typename Container::value_type, Container>;
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
template<class Container, class Allocator>
|
| 45 |
stack(Container, Allocator) -> stack<typename Container::value_type, Container>;
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
template<class T, class Container, class Alloc>
|
| 48 |
struct uses_allocator<stack<T, Container>, Alloc>
|
| 49 |
: uses_allocator<Container, Alloc>::type { };
|
| 50 |
}
|
| 51 |
```
|
|
|
|
| 16 |
|
| 17 |
public:
|
| 18 |
stack() : stack(Container()) {}
|
| 19 |
explicit stack(const Container&);
|
| 20 |
explicit stack(Container&&);
|
| 21 |
+
template<class InputIterator> stack(InputIterator first, InputIterator last);
|
| 22 |
+
template<container-compatible-range<T> R> stack(from_range_t, R&& rg);
|
| 23 |
template<class Alloc> explicit stack(const Alloc&);
|
| 24 |
template<class Alloc> stack(const Container&, const Alloc&);
|
| 25 |
template<class Alloc> stack(Container&&, const Alloc&);
|
| 26 |
template<class Alloc> stack(const stack&, const Alloc&);
|
| 27 |
template<class Alloc> stack(stack&&, const Alloc&);
|
| 28 |
+
template<class InputIterator, class Alloc>
|
| 29 |
+
stack(InputIterator first, InputIterator last, const Alloc&);
|
| 30 |
+
template<container-compatible-range<T> R, class Alloc>
|
| 31 |
+
stack(from_range_t, R&& rg, const Alloc&);
|
| 32 |
|
| 33 |
[[nodiscard]] bool empty() const { return c.empty(); }
|
| 34 |
size_type size() const { return c.size(); }
|
| 35 |
reference top() { return c.back(); }
|
| 36 |
const_reference top() const { return c.back(); }
|
| 37 |
void push(const value_type& x) { c.push_back(x); }
|
| 38 |
void push(value_type&& x) { c.push_back(std::move(x)); }
|
| 39 |
+
template<container-compatible-range<T> R>
|
| 40 |
+
void push_range(R&& rg);
|
| 41 |
template<class... Args>
|
| 42 |
decltype(auto) emplace(Args&&... args)
|
| 43 |
{ return c.emplace_back(std::forward<Args>(args)...); }
|
| 44 |
void pop() { c.pop_back(); }
|
| 45 |
void swap(stack& s) noexcept(is_nothrow_swappable_v<Container>)
|
|
|
|
| 47 |
};
|
| 48 |
|
| 49 |
template<class Container>
|
| 50 |
stack(Container) -> stack<typename Container::value_type, Container>;
|
| 51 |
|
| 52 |
+
template<class InputIterator>
|
| 53 |
+
stack(InputIterator, InputIterator) -> stack<iter-value-type<InputIterator>>;
|
| 54 |
+
|
| 55 |
+
template<ranges::input_range R>
|
| 56 |
+
stack(from_range_t, R&&) -> stack<ranges::range_value_t<R>>;
|
| 57 |
+
|
| 58 |
template<class Container, class Allocator>
|
| 59 |
stack(Container, Allocator) -> stack<typename Container::value_type, Container>;
|
| 60 |
|
| 61 |
+
template<class InputIterator, class Allocator>
|
| 62 |
+
stack(InputIterator, InputIterator, Allocator)
|
| 63 |
+
-> stack<iter-value-type<InputIterator>, deque<iter-value-type<InputIterator>,
|
| 64 |
+
Allocator>>;
|
| 65 |
+
|
| 66 |
+
template<ranges::input_range R, class Allocator>
|
| 67 |
+
stack(from_range_t, R&&, Allocator)
|
| 68 |
+
-> stack<ranges::range_value_t<R>, deque<ranges::range_value_t<R>, Allocator>>;
|
| 69 |
+
|
| 70 |
template<class T, class Container, class Alloc>
|
| 71 |
struct uses_allocator<stack<T, Container>, Alloc>
|
| 72 |
: uses_allocator<Container, Alloc>::type { };
|
| 73 |
}
|
| 74 |
```
|