tmp/tmp3vrwcc3p/{from.md → to.md}
RENAMED
|
@@ -22,24 +22,24 @@ information.
|
|
| 22 |
namespace std {
|
| 23 |
template <class T, class Allocator = allocator<T>>
|
| 24 |
class list {
|
| 25 |
public:
|
| 26 |
// types:
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
|
| 40 |
-
// [list.cons], construct/copy/destroy
|
| 41 |
list() : list(Allocator()) { }
|
| 42 |
explicit list(const Allocator&);
|
| 43 |
explicit list(size_type n, const Allocator& = Allocator());
|
| 44 |
list(size_type n, const T& value, const Allocator& = Allocator());
|
| 45 |
template <class InputIterator>
|
|
@@ -49,11 +49,12 @@ namespace std {
|
|
| 49 |
list(const list&, const Allocator&);
|
| 50 |
list(list&&, const Allocator&);
|
| 51 |
list(initializer_list<T>, const Allocator& = Allocator());
|
| 52 |
~list();
|
| 53 |
list& operator=(const list& x);
|
| 54 |
-
list& operator=(list&& x)
|
|
|
|
| 55 |
list& operator=(initializer_list<T>);
|
| 56 |
template <class InputIterator>
|
| 57 |
void assign(InputIterator first, InputIterator last);
|
| 58 |
void assign(size_type n, const T& t);
|
| 59 |
void assign(initializer_list<T>);
|
|
@@ -72,11 +73,11 @@ namespace std {
|
|
| 72 |
const_iterator cbegin() const noexcept;
|
| 73 |
const_iterator cend() const noexcept;
|
| 74 |
const_reverse_iterator crbegin() const noexcept;
|
| 75 |
const_reverse_iterator crend() const noexcept;
|
| 76 |
|
| 77 |
-
// [list.capacity], capacity
|
| 78 |
bool empty() const noexcept;
|
| 79 |
size_type size() const noexcept;
|
| 80 |
size_type max_size() const noexcept;
|
| 81 |
void resize(size_type sz);
|
| 82 |
void resize(size_type sz, const T& c);
|
|
@@ -85,16 +86,16 @@ namespace std {
|
|
| 85 |
reference front();
|
| 86 |
const_reference front() const;
|
| 87 |
reference back();
|
| 88 |
const_reference back() const;
|
| 89 |
|
| 90 |
-
// [list.modifiers], modifiers
|
| 91 |
-
template <class... Args>
|
| 92 |
-
|
| 93 |
-
template <class... Args> void emplace_back(Args&&... args);
|
| 94 |
void push_front(const T& x);
|
| 95 |
void push_front(T&& x);
|
|
|
|
| 96 |
void push_back(const T& x);
|
| 97 |
void push_back(T&& x);
|
| 98 |
void pop_back();
|
| 99 |
|
| 100 |
template <class... Args> iterator emplace(const_iterator position, Args&&... args);
|
|
@@ -106,14 +107,15 @@ namespace std {
|
|
| 106 |
InputIterator last);
|
| 107 |
iterator insert(const_iterator position, initializer_list<T> il);
|
| 108 |
|
| 109 |
iterator erase(const_iterator position);
|
| 110 |
iterator erase(const_iterator position, const_iterator last);
|
| 111 |
-
void swap(list&)
|
|
|
|
| 112 |
void clear() noexcept;
|
| 113 |
|
| 114 |
-
// [list.ops], list operations
|
| 115 |
void splice(const_iterator position, list& x);
|
| 116 |
void splice(const_iterator position, list&& x);
|
| 117 |
void splice(const_iterator position, list& x, const_iterator i);
|
| 118 |
void splice(const_iterator position, list&& x, const_iterator i);
|
| 119 |
void splice(const_iterator position, list& x,
|
|
@@ -137,10 +139,15 @@ namespace std {
|
|
| 137 |
template <class Compare> void sort(Compare comp);
|
| 138 |
|
| 139 |
void reverse() noexcept;
|
| 140 |
};
|
| 141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
template <class T, class Allocator>
|
| 143 |
bool operator==(const list<T, Allocator>& x, const list<T, Allocator>& y);
|
| 144 |
template <class T, class Allocator>
|
| 145 |
bool operator< (const list<T, Allocator>& x, const list<T, Allocator>& y);
|
| 146 |
template <class T, class Allocator>
|
|
@@ -150,11 +157,17 @@ namespace std {
|
|
| 150 |
template <class T, class Allocator>
|
| 151 |
bool operator>=(const list<T, Allocator>& x, const list<T, Allocator>& y);
|
| 152 |
template <class T, class Allocator>
|
| 153 |
bool operator<=(const list<T, Allocator>& x, const list<T, Allocator>& y);
|
| 154 |
|
| 155 |
-
// specialized algorithms
|
| 156 |
template <class T, class Allocator>
|
| 157 |
-
void swap(list<T,Allocator>& x, list<T,Allocator>& y)
|
|
|
|
| 158 |
}
|
| 159 |
```
|
| 160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
namespace std {
|
| 23 |
template <class T, class Allocator = allocator<T>>
|
| 24 |
class list {
|
| 25 |
public:
|
| 26 |
// types:
|
| 27 |
+
using value_type = T;
|
| 28 |
+
using allocator_type = Allocator;
|
| 29 |
+
using pointer = typename allocator_traits<Allocator>::pointer;
|
| 30 |
+
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
|
| 31 |
+
using reference = value_type&;
|
| 32 |
+
using const_reference = const value_type&;
|
| 33 |
+
using size_type = implementation-defined; // see [container.requirements]
|
| 34 |
+
using difference_type = implementation-defined; // see [container.requirements]
|
| 35 |
+
using iterator = implementation-defined // type of list::iterator; // see [container.requirements]
|
| 36 |
+
using const_iterator = implementation-defined // type of list::const_iterator; // see [container.requirements]
|
| 37 |
+
using reverse_iterator = std::reverse_iterator<iterator>;
|
| 38 |
+
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
| 39 |
|
| 40 |
+
// [list.cons], construct/copy/destroy
|
| 41 |
list() : list(Allocator()) { }
|
| 42 |
explicit list(const Allocator&);
|
| 43 |
explicit list(size_type n, const Allocator& = Allocator());
|
| 44 |
list(size_type n, const T& value, const Allocator& = Allocator());
|
| 45 |
template <class InputIterator>
|
|
|
|
| 49 |
list(const list&, const Allocator&);
|
| 50 |
list(list&&, const Allocator&);
|
| 51 |
list(initializer_list<T>, const Allocator& = Allocator());
|
| 52 |
~list();
|
| 53 |
list& operator=(const list& x);
|
| 54 |
+
list& operator=(list&& x)
|
| 55 |
+
noexcept(allocator_traits<Allocator>::is_always_equal::value);
|
| 56 |
list& operator=(initializer_list<T>);
|
| 57 |
template <class InputIterator>
|
| 58 |
void assign(InputIterator first, InputIterator last);
|
| 59 |
void assign(size_type n, const T& t);
|
| 60 |
void assign(initializer_list<T>);
|
|
|
|
| 73 |
const_iterator cbegin() const noexcept;
|
| 74 |
const_iterator cend() const noexcept;
|
| 75 |
const_reverse_iterator crbegin() const noexcept;
|
| 76 |
const_reverse_iterator crend() const noexcept;
|
| 77 |
|
| 78 |
+
// [list.capacity], capacity
|
| 79 |
bool empty() const noexcept;
|
| 80 |
size_type size() const noexcept;
|
| 81 |
size_type max_size() const noexcept;
|
| 82 |
void resize(size_type sz);
|
| 83 |
void resize(size_type sz, const T& c);
|
|
|
|
| 86 |
reference front();
|
| 87 |
const_reference front() const;
|
| 88 |
reference back();
|
| 89 |
const_reference back() const;
|
| 90 |
|
| 91 |
+
// [list.modifiers], modifiers
|
| 92 |
+
template <class... Args> reference emplace_front(Args&&... args);
|
| 93 |
+
template <class... Args> reference emplace_back(Args&&... args);
|
|
|
|
| 94 |
void push_front(const T& x);
|
| 95 |
void push_front(T&& x);
|
| 96 |
+
void pop_front();
|
| 97 |
void push_back(const T& x);
|
| 98 |
void push_back(T&& x);
|
| 99 |
void pop_back();
|
| 100 |
|
| 101 |
template <class... Args> iterator emplace(const_iterator position, Args&&... args);
|
|
|
|
| 107 |
InputIterator last);
|
| 108 |
iterator insert(const_iterator position, initializer_list<T> il);
|
| 109 |
|
| 110 |
iterator erase(const_iterator position);
|
| 111 |
iterator erase(const_iterator position, const_iterator last);
|
| 112 |
+
void swap(list&)
|
| 113 |
+
noexcept(allocator_traits<Allocator>::is_always_equal::value);
|
| 114 |
void clear() noexcept;
|
| 115 |
|
| 116 |
+
// [list.ops], list operations
|
| 117 |
void splice(const_iterator position, list& x);
|
| 118 |
void splice(const_iterator position, list&& x);
|
| 119 |
void splice(const_iterator position, list& x, const_iterator i);
|
| 120 |
void splice(const_iterator position, list&& x, const_iterator i);
|
| 121 |
void splice(const_iterator position, list& x,
|
|
|
|
| 139 |
template <class Compare> void sort(Compare comp);
|
| 140 |
|
| 141 |
void reverse() noexcept;
|
| 142 |
};
|
| 143 |
|
| 144 |
+
template<class InputIterator,
|
| 145 |
+
class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
|
| 146 |
+
list(InputIterator, InputIterator, Allocator = Allocator())
|
| 147 |
+
-> list<typename iterator_traits<InputIterator>::value_type, Allocator>;
|
| 148 |
+
|
| 149 |
template <class T, class Allocator>
|
| 150 |
bool operator==(const list<T, Allocator>& x, const list<T, Allocator>& y);
|
| 151 |
template <class T, class Allocator>
|
| 152 |
bool operator< (const list<T, Allocator>& x, const list<T, Allocator>& y);
|
| 153 |
template <class T, class Allocator>
|
|
|
|
| 157 |
template <class T, class Allocator>
|
| 158 |
bool operator>=(const list<T, Allocator>& x, const list<T, Allocator>& y);
|
| 159 |
template <class T, class Allocator>
|
| 160 |
bool operator<=(const list<T, Allocator>& x, const list<T, Allocator>& y);
|
| 161 |
|
| 162 |
+
// [list.special], specialized algorithms
|
| 163 |
template <class T, class Allocator>
|
| 164 |
+
void swap(list<T, Allocator>& x, list<T, Allocator>& y)
|
| 165 |
+
noexcept(noexcept(x.swap(y)));
|
| 166 |
}
|
| 167 |
```
|
| 168 |
|
| 169 |
+
An incomplete type `T` may be used when instantiating `list` if the
|
| 170 |
+
allocator satisfies the allocator completeness requirements (
|
| 171 |
+
[[allocator.requirements.completeness]]). `T` shall be complete before
|
| 172 |
+
any member of the resulting specialization of `list` is referenced.
|
| 173 |
+
|