tmp/tmpz451tgdr/{from.md → to.md}
RENAMED
|
@@ -8,12 +8,12 @@ iterator into the list and `n` is an integer, are the same as those of
|
|
| 8 |
list and `n` is an integer, means an iterator `j` such that `j + n == i`
|
| 9 |
is `true`. For `merge` and `sort`, the definitions and requirements in
|
| 10 |
[[alg.sorting]] apply.
|
| 11 |
|
| 12 |
``` cpp
|
| 13 |
-
void splice_after(const_iterator position, forward_list& x);
|
| 14 |
-
void splice_after(const_iterator position, forward_list&& x);
|
| 15 |
```
|
| 16 |
|
| 17 |
*Preconditions:* `position` is `before_begin()` or is a dereferenceable
|
| 18 |
iterator in the range \[`begin()`, `end()`).
|
| 19 |
`get_allocator() == x.get_allocator()` is `true`. `addressof(x) != this`
|
|
@@ -28,12 +28,12 @@ now behave as iterators into `*this`, not into `x`.
|
|
| 28 |
*Throws:* Nothing.
|
| 29 |
|
| 30 |
*Complexity:* 𝑂(`distance(x.begin(), x.end())`)
|
| 31 |
|
| 32 |
``` cpp
|
| 33 |
-
void splice_after(const_iterator position, forward_list& x, const_iterator i);
|
| 34 |
-
void splice_after(const_iterator position, forward_list&& x, const_iterator i);
|
| 35 |
```
|
| 36 |
|
| 37 |
*Preconditions:* `position` is `before_begin()` or is a dereferenceable
|
| 38 |
iterator in the range \[`begin()`, `end()`). The iterator following `i`
|
| 39 |
is a dereferenceable iterator in `x`.
|
|
@@ -49,13 +49,13 @@ behave as iterators into `*this`, not into `x`.
|
|
| 49 |
*Throws:* Nothing.
|
| 50 |
|
| 51 |
*Complexity:* 𝑂(1)
|
| 52 |
|
| 53 |
``` cpp
|
| 54 |
-
void splice_after(const_iterator position, forward_list& x,
|
| 55 |
const_iterator first, const_iterator last);
|
| 56 |
-
void splice_after(const_iterator position, forward_list&& x,
|
| 57 |
const_iterator first, const_iterator last);
|
| 58 |
```
|
| 59 |
|
| 60 |
*Preconditions:* `position` is `before_begin()` or is a dereferenceable
|
| 61 |
iterator in the range \[`begin()`, `end()`). (`first`, `last`) is a
|
|
@@ -71,12 +71,12 @@ continue to refer to their elements, but they now behave as iterators
|
|
| 71 |
into `*this`, not into `x`.
|
| 72 |
|
| 73 |
*Complexity:* 𝑂(`distance(first, last)`)
|
| 74 |
|
| 75 |
``` cpp
|
| 76 |
-
size_type remove(const T& value);
|
| 77 |
-
template<class Predicate> size_type remove_if(Predicate pred);
|
| 78 |
```
|
| 79 |
|
| 80 |
*Effects:* Erases all the elements in the list referred to by a list
|
| 81 |
iterator `i` for which the following conditions hold: `*i == value` (for
|
| 82 |
`remove()`), `pred(*i)` is `true` (for `remove_if()`). Invalidates only
|
|
@@ -91,12 +91,12 @@ comparison or the predicate.
|
|
| 91 |
corresponding predicate.
|
| 92 |
|
| 93 |
*Remarks:* Stable [[algorithm.stable]].
|
| 94 |
|
| 95 |
``` cpp
|
| 96 |
-
size_type unique();
|
| 97 |
-
template<class BinaryPredicate> size_type unique(BinaryPredicate binary_pred);
|
| 98 |
```
|
| 99 |
|
| 100 |
Let `binary_pred` be `equal_to<>{}` for the first overload.
|
| 101 |
|
| 102 |
*Preconditions:* `binary_pred` is an equivalence relation.
|
|
@@ -114,14 +114,14 @@ only the iterators and references to the erased elements.
|
|
| 114 |
*Complexity:* If `empty()` is `false`, exactly
|
| 115 |
`distance(begin(), end()) - 1` applications of the corresponding
|
| 116 |
predicate, otherwise no applications of the predicate.
|
| 117 |
|
| 118 |
``` cpp
|
| 119 |
-
void merge(forward_list& x);
|
| 120 |
-
void merge(forward_list&& x);
|
| 121 |
-
template<class Compare> void merge(forward_list& x, Compare comp);
|
| 122 |
-
template<class Compare> void merge(forward_list&& x, Compare comp);
|
| 123 |
```
|
| 124 |
|
| 125 |
Let `comp` be `less<>` for the first two overloads.
|
| 126 |
|
| 127 |
*Preconditions:* `*this` and `x` are both sorted with respect to the
|
|
@@ -143,12 +143,12 @@ performed.
|
|
| 143 |
*Remarks:* Stable [[algorithm.stable]]. If `addressof(x) != this`, `x`
|
| 144 |
is empty after the merge. No elements are copied by this operation. If
|
| 145 |
an exception is thrown other than by a comparison, there are no effects.
|
| 146 |
|
| 147 |
``` cpp
|
| 148 |
-
void sort();
|
| 149 |
-
template<class Compare> void sort(Compare comp);
|
| 150 |
```
|
| 151 |
|
| 152 |
*Effects:* Sorts the list according to the `operator<` or the `comp`
|
| 153 |
function object. If an exception is thrown, the order of the elements in
|
| 154 |
`*this` is unspecified. Does not affect the validity of iterators and
|
|
@@ -158,11 +158,11 @@ references.
|
|
| 158 |
`distance(begin(), end())`.
|
| 159 |
|
| 160 |
*Remarks:* Stable [[algorithm.stable]].
|
| 161 |
|
| 162 |
``` cpp
|
| 163 |
-
void reverse() noexcept;
|
| 164 |
```
|
| 165 |
|
| 166 |
*Effects:* Reverses the order of the elements in the list. Does not
|
| 167 |
affect the validity of iterators and references.
|
| 168 |
|
|
|
|
| 8 |
list and `n` is an integer, means an iterator `j` such that `j + n == i`
|
| 9 |
is `true`. For `merge` and `sort`, the definitions and requirements in
|
| 10 |
[[alg.sorting]] apply.
|
| 11 |
|
| 12 |
``` cpp
|
| 13 |
+
constexpr void splice_after(const_iterator position, forward_list& x);
|
| 14 |
+
constexpr void splice_after(const_iterator position, forward_list&& x);
|
| 15 |
```
|
| 16 |
|
| 17 |
*Preconditions:* `position` is `before_begin()` or is a dereferenceable
|
| 18 |
iterator in the range \[`begin()`, `end()`).
|
| 19 |
`get_allocator() == x.get_allocator()` is `true`. `addressof(x) != this`
|
|
|
|
| 28 |
*Throws:* Nothing.
|
| 29 |
|
| 30 |
*Complexity:* 𝑂(`distance(x.begin(), x.end())`)
|
| 31 |
|
| 32 |
``` cpp
|
| 33 |
+
constexpr void splice_after(const_iterator position, forward_list& x, const_iterator i);
|
| 34 |
+
constexpr void splice_after(const_iterator position, forward_list&& x, const_iterator i);
|
| 35 |
```
|
| 36 |
|
| 37 |
*Preconditions:* `position` is `before_begin()` or is a dereferenceable
|
| 38 |
iterator in the range \[`begin()`, `end()`). The iterator following `i`
|
| 39 |
is a dereferenceable iterator in `x`.
|
|
|
|
| 49 |
*Throws:* Nothing.
|
| 50 |
|
| 51 |
*Complexity:* 𝑂(1)
|
| 52 |
|
| 53 |
``` cpp
|
| 54 |
+
constexpr void splice_after(const_iterator position, forward_list& x,
|
| 55 |
const_iterator first, const_iterator last);
|
| 56 |
+
constexpr void splice_after(const_iterator position, forward_list&& x,
|
| 57 |
const_iterator first, const_iterator last);
|
| 58 |
```
|
| 59 |
|
| 60 |
*Preconditions:* `position` is `before_begin()` or is a dereferenceable
|
| 61 |
iterator in the range \[`begin()`, `end()`). (`first`, `last`) is a
|
|
|
|
| 71 |
into `*this`, not into `x`.
|
| 72 |
|
| 73 |
*Complexity:* 𝑂(`distance(first, last)`)
|
| 74 |
|
| 75 |
``` cpp
|
| 76 |
+
constexpr size_type remove(const T& value);
|
| 77 |
+
template<class Predicate> constexpr size_type remove_if(Predicate pred);
|
| 78 |
```
|
| 79 |
|
| 80 |
*Effects:* Erases all the elements in the list referred to by a list
|
| 81 |
iterator `i` for which the following conditions hold: `*i == value` (for
|
| 82 |
`remove()`), `pred(*i)` is `true` (for `remove_if()`). Invalidates only
|
|
|
|
| 91 |
corresponding predicate.
|
| 92 |
|
| 93 |
*Remarks:* Stable [[algorithm.stable]].
|
| 94 |
|
| 95 |
``` cpp
|
| 96 |
+
constexpr size_type unique();
|
| 97 |
+
template<class BinaryPredicate> constexpr size_type unique(BinaryPredicate binary_pred);
|
| 98 |
```
|
| 99 |
|
| 100 |
Let `binary_pred` be `equal_to<>{}` for the first overload.
|
| 101 |
|
| 102 |
*Preconditions:* `binary_pred` is an equivalence relation.
|
|
|
|
| 114 |
*Complexity:* If `empty()` is `false`, exactly
|
| 115 |
`distance(begin(), end()) - 1` applications of the corresponding
|
| 116 |
predicate, otherwise no applications of the predicate.
|
| 117 |
|
| 118 |
``` cpp
|
| 119 |
+
constexpr void merge(forward_list& x);
|
| 120 |
+
constexpr void merge(forward_list&& x);
|
| 121 |
+
template<class Compare> constexpr void merge(forward_list& x, Compare comp);
|
| 122 |
+
template<class Compare> constexpr void merge(forward_list&& x, Compare comp);
|
| 123 |
```
|
| 124 |
|
| 125 |
Let `comp` be `less<>` for the first two overloads.
|
| 126 |
|
| 127 |
*Preconditions:* `*this` and `x` are both sorted with respect to the
|
|
|
|
| 143 |
*Remarks:* Stable [[algorithm.stable]]. If `addressof(x) != this`, `x`
|
| 144 |
is empty after the merge. No elements are copied by this operation. If
|
| 145 |
an exception is thrown other than by a comparison, there are no effects.
|
| 146 |
|
| 147 |
``` cpp
|
| 148 |
+
constexpr void sort();
|
| 149 |
+
template<class Compare> constexpr void sort(Compare comp);
|
| 150 |
```
|
| 151 |
|
| 152 |
*Effects:* Sorts the list according to the `operator<` or the `comp`
|
| 153 |
function object. If an exception is thrown, the order of the elements in
|
| 154 |
`*this` is unspecified. Does not affect the validity of iterators and
|
|
|
|
| 158 |
`distance(begin(), end())`.
|
| 159 |
|
| 160 |
*Remarks:* Stable [[algorithm.stable]].
|
| 161 |
|
| 162 |
``` cpp
|
| 163 |
+
constexpr void reverse() noexcept;
|
| 164 |
```
|
| 165 |
|
| 166 |
*Effects:* Reverses the order of the elements in the list. Does not
|
| 167 |
affect the validity of iterators and references.
|
| 168 |
|