tmp/tmpv3s4xp3p/{from.md → to.md}
RENAMED
|
@@ -3,21 +3,21 @@
|
|
| 3 |
A `vector` is a sequence container that supports (amortized) constant
|
| 4 |
time insert and erase operations at the end; insert and erase in the
|
| 5 |
middle take linear time. Storage management is handled automatically,
|
| 6 |
though hints can be given to improve efficiency.
|
| 7 |
|
| 8 |
-
A `vector` meets all of the requirements of a container
|
| 9 |
-
|
| 10 |
-
[[container.
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
element type other than `bool`, of a contiguous container
|
| 14 |
-
[[container.
|
| 15 |
-
`pop_front`, and `emplace_front` member functions,
|
| 16 |
-
provided. Descriptions are provided here only for
|
| 17 |
-
that are not described in one of these tables or
|
| 18 |
-
there is additional semantic information.
|
| 19 |
|
| 20 |
The types `iterator` and `const_iterator` meet the constexpr iterator
|
| 21 |
requirements [[iterator.requirements.general]].
|
| 22 |
|
| 23 |
``` cpp
|
|
@@ -30,12 +30,12 @@ namespace std {
|
|
| 30 |
using allocator_type = Allocator;
|
| 31 |
using pointer = typename allocator_traits<Allocator>::pointer;
|
| 32 |
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
|
| 33 |
using reference = value_type&;
|
| 34 |
using const_reference = const value_type&;
|
| 35 |
-
using size_type = implementation-defined; // see [container.requirements]
|
| 36 |
-
using difference_type = implementation-defined; // see [container.requirements]
|
| 37 |
using iterator = implementation-defined // type of vector::iterator; // see [container.requirements]
|
| 38 |
using const_iterator = implementation-defined // type of vector::const_iterator; // see [container.requirements]
|
| 39 |
using reverse_iterator = std::reverse_iterator<iterator>;
|
| 40 |
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
| 41 |
|
|
@@ -44,23 +44,27 @@ namespace std {
|
|
| 44 |
constexpr explicit vector(const Allocator&) noexcept;
|
| 45 |
constexpr explicit vector(size_type n, const Allocator& = Allocator());
|
| 46 |
constexpr vector(size_type n, const T& value, const Allocator& = Allocator());
|
| 47 |
template<class InputIterator>
|
| 48 |
constexpr vector(InputIterator first, InputIterator last, const Allocator& = Allocator());
|
|
|
|
|
|
|
| 49 |
constexpr vector(const vector& x);
|
| 50 |
constexpr vector(vector&&) noexcept;
|
| 51 |
-
constexpr vector(const vector&, const Allocator&);
|
| 52 |
-
constexpr vector(vector&&, const Allocator&);
|
| 53 |
constexpr vector(initializer_list<T>, const Allocator& = Allocator());
|
| 54 |
constexpr ~vector();
|
| 55 |
constexpr vector& operator=(const vector& x);
|
| 56 |
constexpr vector& operator=(vector&& x)
|
| 57 |
noexcept(allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
|
| 58 |
allocator_traits<Allocator>::is_always_equal::value);
|
| 59 |
constexpr vector& operator=(initializer_list<T>);
|
| 60 |
template<class InputIterator>
|
| 61 |
constexpr void assign(InputIterator first, InputIterator last);
|
|
|
|
|
|
|
| 62 |
constexpr void assign(size_type n, const T& u);
|
| 63 |
constexpr void assign(initializer_list<T>);
|
| 64 |
constexpr allocator_type get_allocator() const noexcept;
|
| 65 |
|
| 66 |
// iterators
|
|
@@ -104,19 +108,23 @@ namespace std {
|
|
| 104 |
|
| 105 |
// [vector.modifiers], modifiers
|
| 106 |
template<class... Args> constexpr reference emplace_back(Args&&... args);
|
| 107 |
constexpr void push_back(const T& x);
|
| 108 |
constexpr void push_back(T&& x);
|
|
|
|
|
|
|
| 109 |
constexpr void pop_back();
|
| 110 |
|
| 111 |
template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
|
| 112 |
constexpr iterator insert(const_iterator position, const T& x);
|
| 113 |
constexpr iterator insert(const_iterator position, T&& x);
|
| 114 |
constexpr iterator insert(const_iterator position, size_type n, const T& x);
|
| 115 |
template<class InputIterator>
|
| 116 |
constexpr iterator insert(const_iterator position,
|
| 117 |
InputIterator first, InputIterator last);
|
|
|
|
|
|
|
| 118 |
constexpr iterator insert(const_iterator position, initializer_list<T> il);
|
| 119 |
constexpr iterator erase(const_iterator position);
|
| 120 |
constexpr iterator erase(const_iterator first, const_iterator last);
|
| 121 |
constexpr void swap(vector&)
|
| 122 |
noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
|
|
@@ -126,14 +134,13 @@ namespace std {
|
|
| 126 |
|
| 127 |
template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>>
|
| 128 |
vector(InputIterator, InputIterator, Allocator = Allocator())
|
| 129 |
-> vector<iter-value-type<InputIterator>, Allocator>;
|
| 130 |
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
noexcept(noexcept(x.swap(y)));
|
| 135 |
}
|
| 136 |
```
|
| 137 |
|
| 138 |
An incomplete type `T` may be used when instantiating `vector` if the
|
| 139 |
allocator meets the allocator completeness requirements
|
|
|
|
| 3 |
A `vector` is a sequence container that supports (amortized) constant
|
| 4 |
time insert and erase operations at the end; insert and erase in the
|
| 5 |
middle take linear time. Storage management is handled automatically,
|
| 6 |
though hints can be given to improve efficiency.
|
| 7 |
|
| 8 |
+
A `vector` meets all of the requirements of a container
|
| 9 |
+
[[container.reqmts]], of a reversible container
|
| 10 |
+
[[container.rev.reqmts]], of an allocator-aware container
|
| 11 |
+
[[container.alloc.reqmts]], of a sequence container, including most of
|
| 12 |
+
the optional sequence container requirements [[sequence.reqmts]], and,
|
| 13 |
+
for an element type other than `bool`, of a contiguous container
|
| 14 |
+
[[container.reqmts]]. The exceptions are the `push_front`,
|
| 15 |
+
`prepend_range`, `pop_front`, and `emplace_front` member functions,
|
| 16 |
+
which are not provided. Descriptions are provided here only for
|
| 17 |
+
operations on `vector` that are not described in one of these tables or
|
| 18 |
+
for operations where there is additional semantic information.
|
| 19 |
|
| 20 |
The types `iterator` and `const_iterator` meet the constexpr iterator
|
| 21 |
requirements [[iterator.requirements.general]].
|
| 22 |
|
| 23 |
``` cpp
|
|
|
|
| 30 |
using allocator_type = Allocator;
|
| 31 |
using pointer = typename allocator_traits<Allocator>::pointer;
|
| 32 |
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
|
| 33 |
using reference = value_type&;
|
| 34 |
using const_reference = const value_type&;
|
| 35 |
+
using size_type = implementation-defined // type of vector::size_type; // see [container.requirements]
|
| 36 |
+
using difference_type = implementation-defined // type of vector::difference_type; // see [container.requirements]
|
| 37 |
using iterator = implementation-defined // type of vector::iterator; // see [container.requirements]
|
| 38 |
using const_iterator = implementation-defined // type of vector::const_iterator; // see [container.requirements]
|
| 39 |
using reverse_iterator = std::reverse_iterator<iterator>;
|
| 40 |
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
| 41 |
|
|
|
|
| 44 |
constexpr explicit vector(const Allocator&) noexcept;
|
| 45 |
constexpr explicit vector(size_type n, const Allocator& = Allocator());
|
| 46 |
constexpr vector(size_type n, const T& value, const Allocator& = Allocator());
|
| 47 |
template<class InputIterator>
|
| 48 |
constexpr vector(InputIterator first, InputIterator last, const Allocator& = Allocator());
|
| 49 |
+
template<container-compatible-range<T> R>
|
| 50 |
+
constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator());
|
| 51 |
constexpr vector(const vector& x);
|
| 52 |
constexpr vector(vector&&) noexcept;
|
| 53 |
+
constexpr vector(const vector&, const type_identity_t<Allocator>&);
|
| 54 |
+
constexpr vector(vector&&, const type_identity_t<Allocator>&);
|
| 55 |
constexpr vector(initializer_list<T>, const Allocator& = Allocator());
|
| 56 |
constexpr ~vector();
|
| 57 |
constexpr vector& operator=(const vector& x);
|
| 58 |
constexpr vector& operator=(vector&& x)
|
| 59 |
noexcept(allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
|
| 60 |
allocator_traits<Allocator>::is_always_equal::value);
|
| 61 |
constexpr vector& 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& u);
|
| 67 |
constexpr void assign(initializer_list<T>);
|
| 68 |
constexpr allocator_type get_allocator() const noexcept;
|
| 69 |
|
| 70 |
// iterators
|
|
|
|
| 108 |
|
| 109 |
// [vector.modifiers], modifiers
|
| 110 |
template<class... Args> constexpr reference emplace_back(Args&&... args);
|
| 111 |
constexpr void push_back(const T& x);
|
| 112 |
constexpr void push_back(T&& x);
|
| 113 |
+
template<container-compatible-range<T> R>
|
| 114 |
+
constexpr void append_range(R&& rg);
|
| 115 |
constexpr void pop_back();
|
| 116 |
|
| 117 |
template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
|
| 118 |
constexpr iterator insert(const_iterator position, const T& x);
|
| 119 |
constexpr iterator insert(const_iterator position, T&& x);
|
| 120 |
constexpr iterator insert(const_iterator position, size_type n, const T& x);
|
| 121 |
template<class InputIterator>
|
| 122 |
constexpr iterator insert(const_iterator position,
|
| 123 |
InputIterator first, InputIterator last);
|
| 124 |
+
template<container-compatible-range<T> R>
|
| 125 |
+
constexpr iterator insert_range(const_iterator position, R&& rg);
|
| 126 |
constexpr iterator insert(const_iterator position, initializer_list<T> il);
|
| 127 |
constexpr iterator erase(const_iterator position);
|
| 128 |
constexpr iterator erase(const_iterator first, const_iterator last);
|
| 129 |
constexpr void swap(vector&)
|
| 130 |
noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
|
|
|
|
| 134 |
|
| 135 |
template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>>
|
| 136 |
vector(InputIterator, InputIterator, Allocator = Allocator())
|
| 137 |
-> vector<iter-value-type<InputIterator>, Allocator>;
|
| 138 |
|
| 139 |
+
template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
|
| 140 |
+
vector(from_range_t, R&&, Allocator = Allocator())
|
| 141 |
+
-> vector<ranges::range_value_t<R>, Allocator>;
|
|
|
|
| 142 |
}
|
| 143 |
```
|
| 144 |
|
| 145 |
An incomplete type `T` may be used when instantiating `vector` if the
|
| 146 |
allocator meets the allocator completeness requirements
|