tmp/tmp_qo_xf3a/{from.md → to.md}
RENAMED
|
@@ -16,137 +16,143 @@ provided.[^2]
|
|
| 16 |
|
| 17 |
Descriptions are provided here only for operations on `list` that are
|
| 18 |
not described in one of these tables or for operations where there is
|
| 19 |
additional semantic information.
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
``` cpp
|
| 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 =
|
| 30 |
-
using const_pointer =
|
| 31 |
using reference = value_type&;
|
| 32 |
using const_reference = const value_type&;
|
| 33 |
using size_type = implementation-defined // type of list::size_type; // see [container.requirements]
|
| 34 |
using difference_type = implementation-defined // type of list::difference_type; // 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>
|
| 46 |
-
list(InputIterator first, InputIterator last, const Allocator& = Allocator());
|
| 47 |
template<container-compatible-range<T> R>
|
| 48 |
-
list(from_range_t, R&& rg, const Allocator& = Allocator());
|
| 49 |
-
list(const list& x);
|
| 50 |
-
list(list&& x);
|
| 51 |
-
list(const list&, const type_identity_t<Allocator>&);
|
| 52 |
-
list(list&&, const type_identity_t<Allocator>&);
|
| 53 |
-
list(initializer_list<T>, const Allocator& = Allocator());
|
| 54 |
-
~list();
|
| 55 |
-
list& operator=(const list& x);
|
| 56 |
-
list& operator=(list&& x)
|
| 57 |
noexcept(allocator_traits<Allocator>::is_always_equal::value);
|
| 58 |
-
list& operator=(initializer_list<T>);
|
| 59 |
template<class InputIterator>
|
| 60 |
-
void assign(InputIterator first, InputIterator last);
|
| 61 |
template<container-compatible-range<T> R>
|
| 62 |
-
void assign_range(R&& rg);
|
| 63 |
-
void assign(size_type n, const T& t);
|
| 64 |
-
void assign(initializer_list<T>);
|
| 65 |
-
allocator_type get_allocator() const noexcept;
|
| 66 |
|
| 67 |
// iterators
|
| 68 |
-
iterator begin() noexcept;
|
| 69 |
-
const_iterator begin() const noexcept;
|
| 70 |
-
iterator end() noexcept;
|
| 71 |
-
const_iterator end() const noexcept;
|
| 72 |
-
reverse_iterator rbegin() noexcept;
|
| 73 |
-
const_reverse_iterator rbegin() const noexcept;
|
| 74 |
-
reverse_iterator rend() noexcept;
|
| 75 |
-
const_reverse_iterator rend() const noexcept;
|
| 76 |
|
| 77 |
-
const_iterator cbegin() const noexcept;
|
| 78 |
-
const_iterator cend() const noexcept;
|
| 79 |
-
const_reverse_iterator crbegin() const noexcept;
|
| 80 |
-
const_reverse_iterator crend() const noexcept;
|
| 81 |
|
| 82 |
// [list.capacity], capacity
|
| 83 |
-
|
| 84 |
-
size_type size() const noexcept;
|
| 85 |
-
size_type max_size() const noexcept;
|
| 86 |
-
void resize(size_type sz);
|
| 87 |
-
void resize(size_type sz, const T& c);
|
| 88 |
|
| 89 |
// element access
|
| 90 |
-
reference front();
|
| 91 |
-
const_reference front() const;
|
| 92 |
-
reference back();
|
| 93 |
-
const_reference back() const;
|
| 94 |
|
| 95 |
// [list.modifiers], modifiers
|
| 96 |
-
template<class... Args> reference emplace_front(Args&&... args);
|
| 97 |
-
template<class... Args> reference emplace_back(Args&&... args);
|
| 98 |
-
void push_front(const T& x);
|
| 99 |
-
void push_front(T&& x);
|
| 100 |
template<container-compatible-range<T> R>
|
| 101 |
-
void prepend_range(R&& rg);
|
| 102 |
-
void pop_front();
|
| 103 |
-
void push_back(const T& x);
|
| 104 |
-
void push_back(T&& x);
|
| 105 |
template<container-compatible-range<T> R>
|
| 106 |
-
void append_range(R&& rg);
|
| 107 |
-
void pop_back();
|
| 108 |
|
| 109 |
-
template<class... Args> iterator emplace(const_iterator position, Args&&... args);
|
| 110 |
-
iterator insert(const_iterator position, const T& x);
|
| 111 |
-
iterator insert(const_iterator position, T&& x);
|
| 112 |
-
iterator insert(const_iterator position, size_type n, const T& x);
|
| 113 |
template<class InputIterator>
|
| 114 |
-
iterator insert(const_iterator position,
|
|
|
|
| 115 |
template<container-compatible-range<T> R>
|
| 116 |
-
iterator insert_range(const_iterator position, R&& rg);
|
| 117 |
-
iterator insert(const_iterator position, initializer_list<T> il);
|
| 118 |
|
| 119 |
-
iterator erase(const_iterator position);
|
| 120 |
-
iterator erase(const_iterator position, const_iterator last);
|
| 121 |
-
void swap(list&) noexcept(allocator_traits<Allocator>::is_always_equal::value);
|
| 122 |
-
void clear() noexcept;
|
| 123 |
|
| 124 |
// [list.ops], list operations
|
| 125 |
-
void splice(const_iterator position, list& x);
|
| 126 |
-
void splice(const_iterator position, list&& x);
|
| 127 |
-
void splice(const_iterator position, list& x, const_iterator i);
|
| 128 |
-
void splice(const_iterator position, list&& x, const_iterator i);
|
| 129 |
-
void splice(const_iterator position, list& x,
|
| 130 |
-
|
|
|
|
|
|
|
| 131 |
|
| 132 |
-
size_type remove(const T& value);
|
| 133 |
-
template<class Predicate> size_type remove_if(Predicate pred);
|
| 134 |
|
| 135 |
-
size_type unique();
|
| 136 |
template<class BinaryPredicate>
|
| 137 |
-
size_type unique(BinaryPredicate binary_pred);
|
| 138 |
|
| 139 |
-
void merge(list& x);
|
| 140 |
-
void merge(list&& x);
|
| 141 |
-
template<class Compare> void merge(list& x, Compare comp);
|
| 142 |
-
template<class Compare> void merge(list&& x, Compare comp);
|
| 143 |
|
| 144 |
-
void sort();
|
| 145 |
-
template<class Compare> void sort(Compare comp);
|
| 146 |
|
| 147 |
-
void reverse() noexcept;
|
| 148 |
};
|
| 149 |
|
| 150 |
template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>>
|
| 151 |
list(InputIterator, InputIterator, Allocator = Allocator())
|
| 152 |
-> list<iter-value-type<InputIterator>, Allocator>;
|
|
|
|
| 16 |
|
| 17 |
Descriptions are provided here only for operations on `list` that are
|
| 18 |
not described in one of these tables or for operations where there is
|
| 19 |
additional semantic information.
|
| 20 |
|
| 21 |
+
The types `iterator` and `const_iterator` meet the constexpr iterator
|
| 22 |
+
requirements [[iterator.requirements.general]].
|
| 23 |
+
|
| 24 |
``` cpp
|
| 25 |
namespace std {
|
| 26 |
template<class T, class Allocator = allocator<T>>
|
| 27 |
class list {
|
| 28 |
public:
|
| 29 |
// types
|
| 30 |
using value_type = T;
|
| 31 |
using allocator_type = Allocator;
|
| 32 |
+
using pointer = allocator_traits<Allocator>::pointer;
|
| 33 |
+
using const_pointer = allocator_traits<Allocator>::const_pointer;
|
| 34 |
using reference = value_type&;
|
| 35 |
using const_reference = const value_type&;
|
| 36 |
using size_type = implementation-defined // type of list::size_type; // see [container.requirements]
|
| 37 |
using difference_type = implementation-defined // type of list::difference_type; // see [container.requirements]
|
| 38 |
using iterator = implementation-defined // type of list::iterator; // see [container.requirements]
|
| 39 |
using const_iterator = implementation-defined // type of list::const_iterator; // see [container.requirements]
|
| 40 |
using reverse_iterator = std::reverse_iterator<iterator>;
|
| 41 |
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
| 42 |
|
| 43 |
// [list.cons], construct/copy/destroy
|
| 44 |
+
constexpr list() : list(Allocator()) { }
|
| 45 |
+
constexpr explicit list(const Allocator&);
|
| 46 |
+
constexpr explicit list(size_type n, const Allocator& = Allocator());
|
| 47 |
+
constexpr list(size_type n, const T& value, const Allocator& = Allocator());
|
| 48 |
template<class InputIterator>
|
| 49 |
+
constexpr list(InputIterator first, InputIterator last, const Allocator& = Allocator());
|
| 50 |
template<container-compatible-range<T> R>
|
| 51 |
+
constexpr list(from_range_t, R&& rg, const Allocator& = Allocator());
|
| 52 |
+
constexpr list(const list& x);
|
| 53 |
+
constexpr list(list&& x);
|
| 54 |
+
constexpr list(const list&, const type_identity_t<Allocator>&);
|
| 55 |
+
constexpr list(list&&, const type_identity_t<Allocator>&);
|
| 56 |
+
constexpr list(initializer_list<T>, const Allocator& = Allocator());
|
| 57 |
+
constexpr ~list();
|
| 58 |
+
constexpr list& operator=(const list& x);
|
| 59 |
+
constexpr list& operator=(list&& x)
|
| 60 |
noexcept(allocator_traits<Allocator>::is_always_equal::value);
|
| 61 |
+
constexpr list& operator=(initializer_list<T>);
|
| 62 |
template<class InputIterator>
|
| 63 |
+
constexpr void assign(InputIterator first, InputIterator last);
|
| 64 |
template<container-compatible-range<T> R>
|
| 65 |
+
constexpr void assign_range(R&& rg);
|
| 66 |
+
constexpr void assign(size_type n, const T& t);
|
| 67 |
+
constexpr void assign(initializer_list<T>);
|
| 68 |
+
constexpr allocator_type get_allocator() const noexcept;
|
| 69 |
|
| 70 |
// iterators
|
| 71 |
+
constexpr iterator begin() noexcept;
|
| 72 |
+
constexpr const_iterator begin() const noexcept;
|
| 73 |
+
constexpr iterator end() noexcept;
|
| 74 |
+
constexpr const_iterator end() const noexcept;
|
| 75 |
+
constexpr reverse_iterator rbegin() noexcept;
|
| 76 |
+
constexpr const_reverse_iterator rbegin() const noexcept;
|
| 77 |
+
constexpr reverse_iterator rend() noexcept;
|
| 78 |
+
constexpr const_reverse_iterator rend() const noexcept;
|
| 79 |
|
| 80 |
+
constexpr const_iterator cbegin() const noexcept;
|
| 81 |
+
constexpr const_iterator cend() const noexcept;
|
| 82 |
+
constexpr const_reverse_iterator crbegin() const noexcept;
|
| 83 |
+
constexpr const_reverse_iterator crend() const noexcept;
|
| 84 |
|
| 85 |
// [list.capacity], capacity
|
| 86 |
+
constexpr bool empty() const noexcept;
|
| 87 |
+
constexpr size_type size() const noexcept;
|
| 88 |
+
constexpr size_type max_size() const noexcept;
|
| 89 |
+
constexpr void resize(size_type sz);
|
| 90 |
+
constexpr void resize(size_type sz, const T& c);
|
| 91 |
|
| 92 |
// element access
|
| 93 |
+
constexpr reference front();
|
| 94 |
+
constexpr const_reference front() const;
|
| 95 |
+
constexpr reference back();
|
| 96 |
+
constexpr const_reference back() const;
|
| 97 |
|
| 98 |
// [list.modifiers], modifiers
|
| 99 |
+
template<class... Args> constexpr reference emplace_front(Args&&... args);
|
| 100 |
+
template<class... Args> constexpr reference emplace_back(Args&&... args);
|
| 101 |
+
constexpr void push_front(const T& x);
|
| 102 |
+
constexpr void push_front(T&& x);
|
| 103 |
template<container-compatible-range<T> R>
|
| 104 |
+
constexpr void prepend_range(R&& rg);
|
| 105 |
+
constexpr void pop_front();
|
| 106 |
+
constexpr void push_back(const T& x);
|
| 107 |
+
constexpr void push_back(T&& x);
|
| 108 |
template<container-compatible-range<T> R>
|
| 109 |
+
constexpr void append_range(R&& rg);
|
| 110 |
+
constexpr void pop_back();
|
| 111 |
|
| 112 |
+
template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
|
| 113 |
+
constexpr iterator insert(const_iterator position, const T& x);
|
| 114 |
+
constexpr iterator insert(const_iterator position, T&& x);
|
| 115 |
+
constexpr iterator insert(const_iterator position, size_type n, const T& x);
|
| 116 |
template<class InputIterator>
|
| 117 |
+
constexpr iterator insert(const_iterator position,
|
| 118 |
+
InputIterator first, InputIterator last);
|
| 119 |
template<container-compatible-range<T> R>
|
| 120 |
+
constexpr iterator insert_range(const_iterator position, R&& rg);
|
| 121 |
+
constexpr iterator insert(const_iterator position, initializer_list<T> il);
|
| 122 |
|
| 123 |
+
constexpr iterator erase(const_iterator position);
|
| 124 |
+
constexpr iterator erase(const_iterator position, const_iterator last);
|
| 125 |
+
constexpr void swap(list&) noexcept(allocator_traits<Allocator>::is_always_equal::value);
|
| 126 |
+
constexpr void clear() noexcept;
|
| 127 |
|
| 128 |
// [list.ops], list operations
|
| 129 |
+
constexpr void splice(const_iterator position, list& x);
|
| 130 |
+
constexpr void splice(const_iterator position, list&& x);
|
| 131 |
+
constexpr void splice(const_iterator position, list& x, const_iterator i);
|
| 132 |
+
constexpr void splice(const_iterator position, list&& x, const_iterator i);
|
| 133 |
+
constexpr void splice(const_iterator position, list& x,
|
| 134 |
+
const_iterator first, const_iterator last);
|
| 135 |
+
constexpr void splice(const_iterator position, list&& x,
|
| 136 |
+
const_iterator first, const_iterator last);
|
| 137 |
|
| 138 |
+
constexpr size_type remove(const T& value);
|
| 139 |
+
template<class Predicate> constexpr size_type remove_if(Predicate pred);
|
| 140 |
|
| 141 |
+
constexpr size_type unique();
|
| 142 |
template<class BinaryPredicate>
|
| 143 |
+
constexpr size_type unique(BinaryPredicate binary_pred);
|
| 144 |
|
| 145 |
+
constexpr void merge(list& x);
|
| 146 |
+
constexpr void merge(list&& x);
|
| 147 |
+
template<class Compare> constexpr void merge(list& x, Compare comp);
|
| 148 |
+
template<class Compare> constexpr void merge(list&& x, Compare comp);
|
| 149 |
|
| 150 |
+
constexpr void sort();
|
| 151 |
+
template<class Compare> constexpr void sort(Compare comp);
|
| 152 |
|
| 153 |
+
constexpr void reverse() noexcept;
|
| 154 |
};
|
| 155 |
|
| 156 |
template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>>
|
| 157 |
list(InputIterator, InputIterator, Allocator = Allocator())
|
| 158 |
-> list<iter-value-type<InputIterator>, Allocator>;
|