From Jason Turner

[vector.modifiers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpu84kkcd_/{from.md → to.md} +11 -7
tmp/tmpu84kkcd_/{from.md → to.md} RENAMED
@@ -4,18 +4,26 @@
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
@@ -27,26 +35,22 @@ 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
 
 
 
 
45
  *Complexity:* The destructor of `T` is called the number of times equal
46
  to the number of the elements erased, but the assignment operator of `T`
47
  is called the number of times equal to the number of elements in the
48
  vector after the erased elements.
49
 
50
- *Throws:* Nothing unless an exception is thrown by the assignment
51
- operator or move assignment operator of `T`.
52
-
 
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
+ template<container-compatible-range<T> R>
10
+ constexpr iterator insert_range(const_iterator position, R&& rg);
11
  constexpr iterator insert(const_iterator position, initializer_list<T>);
12
 
13
  template<class... Args> constexpr reference emplace_back(Args&&... args);
14
  template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
15
  constexpr void push_back(const T& x);
16
  constexpr void push_back(T&& x);
17
+ template<container-compatible-range<T> R>
18
+ constexpr void append_range(R&& rg);
19
  ```
20
 
21
+ *Complexity:* If reallocation happens, linear in the number of elements
22
+ of the resulting vector; otherwise, linear in the number of elements
23
+ inserted plus the distance to the end of the vector.
24
+
25
  *Remarks:* Causes reallocation if the new size is greater than the old
26
  capacity. Reallocation invalidates all the references, pointers, and
27
  iterators referring to the elements in the sequence, as well as the
28
  past-the-end iterator. If no reallocation happens, then references,
29
  pointers, and iterators before the insertion point remain valid but
 
35
  at the end and `T` is *Cpp17CopyInsertable* or
36
  `is_nothrow_move_constructible_v<T>` is `true`, there are no effects.
37
  Otherwise, if an exception is thrown by the move constructor of a
38
  non-*Cpp17CopyInsertable* `T`, the effects are unspecified.
39
 
 
 
 
 
40
  ``` cpp
41
  constexpr iterator erase(const_iterator position);
42
  constexpr iterator erase(const_iterator first, const_iterator last);
43
  constexpr void pop_back();
44
  ```
45
 
46
  *Effects:* Invalidates iterators and references at or after the point of
47
  the erase.
48
 
49
+ *Throws:* Nothing unless an exception is thrown by the assignment
50
+ operator or move assignment operator of `T`.
51
+
52
  *Complexity:* The destructor of `T` is called the number of times equal
53
  to the number of the elements erased, but the assignment operator of `T`
54
  is called the number of times equal to the number of elements in the
55
  vector after the erased elements.
56