From Jason Turner

[forwardlist.modifiers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp3w2iz8xu/{from.md → to.md} +13 -13
tmp/tmp3w2iz8xu/{from.md → to.md} RENAMED
@@ -1,6 +1,6 @@
1
- #### `forward_list` modifiers <a id="forwardlist.modifiers">[[forwardlist.modifiers]]</a>
2
 
3
  None of the overloads of `insert_after` shall affect the validity of
4
  iterators and references, and `erase_after` shall invalidate only
5
  iterators and references to the erased elements. If an exception is
6
  thrown during `insert_after` there shall be no effect. Inserting `n`
@@ -32,22 +32,22 @@ void pop_front();
32
  ``` cpp
33
  iterator insert_after(const_iterator position, const T& x);
34
  iterator insert_after(const_iterator position, T&& x);
35
  ```
36
 
37
- *Requires:* `position` is `before_begin()` or is a dereferenceable
38
  iterator in the range \[`begin()`, `end()`).
39
 
40
  *Effects:* Inserts a copy of `x` after `position`.
41
 
42
  *Returns:* An iterator pointing to the copy of `x`.
43
 
44
  ``` cpp
45
  iterator insert_after(const_iterator position, size_type n, const T& x);
46
  ```
47
 
48
- *Requires:* `position` is `before_begin()` or is a dereferenceable
49
  iterator in the range \[`begin()`, `end()`).
50
 
51
  *Effects:* Inserts `n` copies of `x` after `position`.
52
 
53
  *Returns:* An iterator pointing to the last inserted copy of `x` or
@@ -56,13 +56,13 @@ iterator in the range \[`begin()`, `end()`).
56
  ``` cpp
57
  template<class InputIterator>
58
  iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
59
  ```
60
 
61
- *Requires:* `position` is `before_begin()` or is a dereferenceable
62
- iterator in the range \[`begin()`, `end()`). `first` and `last` are not
63
- iterators in `*this`.
64
 
65
  *Effects:* Inserts copies of elements in \[`first`, `last`) after
66
  `position`.
67
 
68
  *Returns:* An iterator pointing to the last inserted element or
@@ -80,11 +80,11 @@ iterator insert_after(const_iterator position, initializer_list<T> il);
80
  ``` cpp
81
  template<class... Args>
82
  iterator emplace_after(const_iterator position, Args&&... args);
83
  ```
84
 
85
- *Requires:* `position` is `before_begin()` or is a dereferenceable
86
  iterator in the range \[`begin()`, `end()`).
87
 
88
  *Effects:* Inserts an object of type `value_type` constructed with
89
  `value_type(std::forward<Args>(args)...)` after `position`.
90
 
@@ -92,11 +92,11 @@ iterator in the range \[`begin()`, `end()`).
92
 
93
  ``` cpp
94
  iterator erase_after(const_iterator position);
95
  ```
96
 
97
- *Requires:* The iterator following `position` is dereferenceable.
98
 
99
  *Effects:* Erases the element pointed to by the iterator following
100
  `position`.
101
 
102
  *Returns:* An iterator pointing to the element following the one that
@@ -106,11 +106,11 @@ was erased, or `end()` if no such element exists.
106
 
107
  ``` cpp
108
  iterator erase_after(const_iterator position, const_iterator last);
109
  ```
110
 
111
- *Requires:* All iterators in the range (`position`, `last`) are
112
  dereferenceable.
113
 
114
  *Effects:* Erases the elements in the range (`position`, `last`).
115
 
116
  *Returns:* `last`.
@@ -119,28 +119,28 @@ dereferenceable.
119
 
120
  ``` cpp
121
  void resize(size_type sz);
122
  ```
123
 
 
 
124
  *Effects:* If `sz < distance(begin(), end())`, erases the last
125
  `distance(begin(), end()) - sz` elements from the list. Otherwise,
126
  inserts `sz - distance(begin(), end())` default-inserted elements at the
127
  end of the list.
128
 
129
- *Requires:* `T` shall be `DefaultInsertable` into `*this`.
130
-
131
  ``` cpp
132
  void resize(size_type sz, const value_type& c);
133
  ```
134
 
 
 
135
  *Effects:* If `sz < distance(begin(), end())`, erases the last
136
  `distance(begin(), end()) - sz` elements from the list. Otherwise,
137
  inserts `sz - distance(begin(), end())` copies of `c` at the end of the
138
  list.
139
 
140
- *Requires:* `T` shall be `CopyInsertable` into `*this`.
141
-
142
  ``` cpp
143
  void clear() noexcept;
144
  ```
145
 
146
  *Effects:* Erases all elements in the range \[`begin()`, `end()`).
 
1
+ #### Modifiers <a id="forwardlist.modifiers">[[forwardlist.modifiers]]</a>
2
 
3
  None of the overloads of `insert_after` shall affect the validity of
4
  iterators and references, and `erase_after` shall invalidate only
5
  iterators and references to the erased elements. If an exception is
6
  thrown during `insert_after` there shall be no effect. Inserting `n`
 
32
  ``` cpp
33
  iterator insert_after(const_iterator position, const T& x);
34
  iterator insert_after(const_iterator position, T&& x);
35
  ```
36
 
37
+ *Preconditions:* `position` is `before_begin()` or is a dereferenceable
38
  iterator in the range \[`begin()`, `end()`).
39
 
40
  *Effects:* Inserts a copy of `x` after `position`.
41
 
42
  *Returns:* An iterator pointing to the copy of `x`.
43
 
44
  ``` cpp
45
  iterator insert_after(const_iterator position, size_type n, const T& x);
46
  ```
47
 
48
+ *Preconditions:* `position` is `before_begin()` or is a dereferenceable
49
  iterator in the range \[`begin()`, `end()`).
50
 
51
  *Effects:* Inserts `n` copies of `x` after `position`.
52
 
53
  *Returns:* An iterator pointing to the last inserted copy of `x` or
 
56
  ``` cpp
57
  template<class InputIterator>
58
  iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
59
  ```
60
 
61
+ *Preconditions:* `position` is `before_begin()` or is a dereferenceable
62
+ iterator in the range \[`begin()`, `end()`). Neither `first` nor `last`
63
+ are iterators in `*this`.
64
 
65
  *Effects:* Inserts copies of elements in \[`first`, `last`) after
66
  `position`.
67
 
68
  *Returns:* An iterator pointing to the last inserted element or
 
80
  ``` cpp
81
  template<class... Args>
82
  iterator emplace_after(const_iterator position, Args&&... args);
83
  ```
84
 
85
+ *Preconditions:* `position` is `before_begin()` or is a dereferenceable
86
  iterator in the range \[`begin()`, `end()`).
87
 
88
  *Effects:* Inserts an object of type `value_type` constructed with
89
  `value_type(std::forward<Args>(args)...)` after `position`.
90
 
 
92
 
93
  ``` cpp
94
  iterator erase_after(const_iterator position);
95
  ```
96
 
97
+ *Preconditions:* The iterator following `position` is dereferenceable.
98
 
99
  *Effects:* Erases the element pointed to by the iterator following
100
  `position`.
101
 
102
  *Returns:* An iterator pointing to the element following the one that
 
106
 
107
  ``` cpp
108
  iterator erase_after(const_iterator position, const_iterator last);
109
  ```
110
 
111
+ *Preconditions:* All iterators in the range (`position`, `last`) are
112
  dereferenceable.
113
 
114
  *Effects:* Erases the elements in the range (`position`, `last`).
115
 
116
  *Returns:* `last`.
 
119
 
120
  ``` cpp
121
  void resize(size_type sz);
122
  ```
123
 
124
+ *Preconditions:* `T` is *Cpp17DefaultInsertable* into `*this`.
125
+
126
  *Effects:* If `sz < distance(begin(), end())`, erases the last
127
  `distance(begin(), end()) - sz` elements from the list. Otherwise,
128
  inserts `sz - distance(begin(), end())` default-inserted elements at the
129
  end of the list.
130
 
 
 
131
  ``` cpp
132
  void resize(size_type sz, const value_type& c);
133
  ```
134
 
135
+ *Preconditions:* `T` is *Cpp17CopyInsertable* into `*this`.
136
+
137
  *Effects:* If `sz < distance(begin(), end())`, erases the last
138
  `distance(begin(), end()) - sz` elements from the list. Otherwise,
139
  inserts `sz - distance(begin(), end())` copies of `c` at the end of the
140
  list.
141
 
 
 
142
  ``` cpp
143
  void clear() noexcept;
144
  ```
145
 
146
  *Effects:* Erases all elements in the range \[`begin()`, `end()`).