tmp/tmpvwaep7y3/{from.md → to.md}
RENAMED
|
@@ -6,22 +6,22 @@ function templates use `+` and `-` for random access iterators (and are,
|
|
| 6 |
therefore, constant time for them); for input, forward and bidirectional
|
| 7 |
iterators they use `++` to provide linear time implementations.
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
template <class InputIterator, class Distance>
|
| 11 |
-
void advance(InputIterator& i, Distance n);
|
| 12 |
```
|
| 13 |
|
| 14 |
*Requires:* `n` shall be negative only for bidirectional and random
|
| 15 |
access iterators.
|
| 16 |
|
| 17 |
*Effects:* Increments (or decrements for negative `n`) iterator
|
| 18 |
reference `i` by `n`.
|
| 19 |
|
| 20 |
``` cpp
|
| 21 |
template <class InputIterator>
|
| 22 |
-
|
| 23 |
distance(InputIterator first, InputIterator last);
|
| 24 |
```
|
| 25 |
|
| 26 |
*Effects:* If `InputIterator` meets the requirements of random access
|
| 27 |
iterator, returns `(last - first)`; otherwise, returns the number of
|
|
@@ -31,20 +31,20 @@ increments needed to get from `first` to `last`.
|
|
| 31 |
iterator, `last` shall be reachable from `first` or `first` shall be
|
| 32 |
reachable from `last`; otherwise, `last` shall be reachable from
|
| 33 |
`first`.
|
| 34 |
|
| 35 |
``` cpp
|
| 36 |
-
template <class
|
| 37 |
-
|
| 38 |
-
typename
|
| 39 |
```
|
| 40 |
|
| 41 |
-
*Effects:* Equivalent to `advance(x, n); return x;`
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
template <class BidirectionalIterator>
|
| 45 |
-
BidirectionalIterator prev(BidirectionalIterator x,
|
| 46 |
-
typename
|
| 47 |
```
|
| 48 |
|
| 49 |
-
*Effects:* Equivalent to `advance(x, -n); return x;`
|
| 50 |
|
|
|
|
| 6 |
therefore, constant time for them); for input, forward and bidirectional
|
| 7 |
iterators they use `++` to provide linear time implementations.
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
template <class InputIterator, class Distance>
|
| 11 |
+
constexpr void advance(InputIterator& i, Distance n);
|
| 12 |
```
|
| 13 |
|
| 14 |
*Requires:* `n` shall be negative only for bidirectional and random
|
| 15 |
access iterators.
|
| 16 |
|
| 17 |
*Effects:* Increments (or decrements for negative `n`) iterator
|
| 18 |
reference `i` by `n`.
|
| 19 |
|
| 20 |
``` cpp
|
| 21 |
template <class InputIterator>
|
| 22 |
+
constexpr typename iterator_traits<InputIterator>::difference_type
|
| 23 |
distance(InputIterator first, InputIterator last);
|
| 24 |
```
|
| 25 |
|
| 26 |
*Effects:* If `InputIterator` meets the requirements of random access
|
| 27 |
iterator, returns `(last - first)`; otherwise, returns the number of
|
|
|
|
| 31 |
iterator, `last` shall be reachable from `first` or `first` shall be
|
| 32 |
reachable from `last`; otherwise, `last` shall be reachable from
|
| 33 |
`first`.
|
| 34 |
|
| 35 |
``` cpp
|
| 36 |
+
template <class InputIterator>
|
| 37 |
+
constexpr InputIterator next(InputIterator x,
|
| 38 |
+
typename iterator_traits<InputIterator>::difference_type n = 1);
|
| 39 |
```
|
| 40 |
|
| 41 |
+
*Effects:* Equivalent to: `advance(x, n); return x;`
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
template <class BidirectionalIterator>
|
| 45 |
+
constexpr BidirectionalIterator prev(BidirectionalIterator x,
|
| 46 |
+
typename iterator_traits<BidirectionalIterator>::difference_type n = 1);
|
| 47 |
```
|
| 48 |
|
| 49 |
+
*Effects:* Equivalent to: `advance(x, -n); return x;`
|
| 50 |
|