tmp/tmpb_qcjgl2/{from.md → to.md}
RENAMED
|
@@ -1,41 +1,44 @@
|
|
| 1 |
-
####
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
iterator insert(const_iterator position, const T& x);
|
| 5 |
-
iterator insert(const_iterator position, T&& x);
|
| 6 |
-
iterator insert(const_iterator position, size_type n, const T& x);
|
| 7 |
template<class InputIterator>
|
| 8 |
-
iterator insert(const_iterator position, InputIterator first, InputIterator last);
|
| 9 |
-
iterator insert(const_iterator position, initializer_list<T>);
|
| 10 |
|
| 11 |
-
template
|
| 12 |
-
template
|
| 13 |
-
void push_back(const T& x);
|
| 14 |
-
void push_back(T&& x);
|
| 15 |
```
|
| 16 |
|
| 17 |
*Remarks:* Causes reallocation if the new size is greater than the old
|
| 18 |
capacity. Reallocation invalidates all the references, pointers, and
|
| 19 |
-
iterators referring to the elements in the sequence
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
| 26 |
`is_nothrow_move_constructible_v<T>` is `true`, there are no effects.
|
| 27 |
Otherwise, if an exception is thrown by the move constructor of a
|
| 28 |
-
non-
|
| 29 |
|
| 30 |
-
*Complexity:*
|
|
|
|
| 31 |
inserted plus the distance to the end of the vector.
|
| 32 |
|
| 33 |
``` cpp
|
| 34 |
-
iterator erase(const_iterator position);
|
| 35 |
-
iterator erase(const_iterator first, const_iterator last);
|
| 36 |
-
void pop_back();
|
| 37 |
```
|
| 38 |
|
| 39 |
*Effects:* Invalidates iterators and references at or after the point of
|
| 40 |
the erase.
|
| 41 |
|
|
|
|
| 1 |
+
#### Modifiers <a id="vector.modifiers">[[vector.modifiers]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
constexpr iterator insert(const_iterator position, const T& x);
|
| 5 |
+
constexpr iterator insert(const_iterator position, T&& x);
|
| 6 |
+
constexpr iterator insert(const_iterator position, size_type n, const T& x);
|
| 7 |
template<class InputIterator>
|
| 8 |
+
constexpr iterator insert(const_iterator position, InputIterator first, InputIterator last);
|
| 9 |
+
constexpr iterator insert(const_iterator position, initializer_list<T>);
|
| 10 |
|
| 11 |
+
template<class... Args> constexpr reference emplace_back(Args&&... args);
|
| 12 |
+
template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
|
| 13 |
+
constexpr void push_back(const T& x);
|
| 14 |
+
constexpr void push_back(T&& x);
|
| 15 |
```
|
| 16 |
|
| 17 |
*Remarks:* Causes reallocation if the new size is greater than the old
|
| 18 |
capacity. Reallocation invalidates all the references, pointers, and
|
| 19 |
+
iterators referring to the elements in the sequence, as well as the
|
| 20 |
+
past-the-end iterator. If no reallocation happens, then references,
|
| 21 |
+
pointers, and iterators before the insertion point remain valid but
|
| 22 |
+
those at or after the insertion point, including the past-the-end
|
| 23 |
+
iterator, are invalidated. If an exception is thrown other than by the
|
| 24 |
+
copy constructor, move constructor, assignment operator, or move
|
| 25 |
+
assignment operator of `T` or by any `InputIterator` operation there are
|
| 26 |
+
no effects. If an exception is thrown while inserting a single element
|
| 27 |
+
at the end and `T` is *Cpp17CopyInsertable* or
|
| 28 |
`is_nothrow_move_constructible_v<T>` is `true`, there are no effects.
|
| 29 |
Otherwise, if an exception is thrown by the move constructor of a
|
| 30 |
+
non-*Cpp17CopyInsertable* `T`, the effects are unspecified.
|
| 31 |
|
| 32 |
+
*Complexity:* If reallocation happens, linear in the number of elements
|
| 33 |
+
of the resulting vector; otherwise, linear in the number of elements
|
| 34 |
inserted plus the distance to the end of the vector.
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
+
constexpr iterator erase(const_iterator position);
|
| 38 |
+
constexpr iterator erase(const_iterator first, const_iterator last);
|
| 39 |
+
constexpr void pop_back();
|
| 40 |
```
|
| 41 |
|
| 42 |
*Effects:* Invalidates iterators and references at or after the point of
|
| 43 |
the erase.
|
| 44 |
|