tmp/tmp56jzqjb6/{from.md → to.md}
RENAMED
|
@@ -34,13 +34,13 @@ namespace std {
|
|
| 34 |
public:
|
| 35 |
using iterator_type = I;
|
| 36 |
using value_type = iter_value_t<I>; // present only
|
| 37 |
// if I models indirectly_readable
|
| 38 |
using difference_type = iter_difference_t<I>;
|
| 39 |
-
using iterator_concept =
|
| 40 |
// if the qualified-id I::iterator_concept is valid and denotes a type
|
| 41 |
-
using iterator_category =
|
| 42 |
// if the qualified-id I::iterator_category is valid and denotes a type
|
| 43 |
constexpr counted_iterator() requires default_initializable<I> = default;
|
| 44 |
constexpr counted_iterator(I x, iter_difference_t<I> n);
|
| 45 |
template<class I2>
|
| 46 |
requires convertible_to<const I2&, I>
|
|
@@ -81,30 +81,30 @@ namespace std {
|
|
| 81 |
requires random_access_iterator<I>;
|
| 82 |
template<common_with<I> I2>
|
| 83 |
friend constexpr iter_difference_t<I2> operator-(
|
| 84 |
const counted_iterator& x, const counted_iterator<I2>& y);
|
| 85 |
friend constexpr iter_difference_t<I> operator-(
|
| 86 |
-
const counted_iterator& x, default_sentinel_t);
|
| 87 |
friend constexpr iter_difference_t<I> operator-(
|
| 88 |
-
default_sentinel_t, const counted_iterator& y);
|
| 89 |
constexpr counted_iterator& operator-=(iter_difference_t<I> n)
|
| 90 |
requires random_access_iterator<I>;
|
| 91 |
|
| 92 |
constexpr decltype(auto) operator[](iter_difference_t<I> n) const
|
| 93 |
requires random_access_iterator<I>;
|
| 94 |
|
| 95 |
template<common_with<I> I2>
|
| 96 |
friend constexpr bool operator==(
|
| 97 |
const counted_iterator& x, const counted_iterator<I2>& y);
|
| 98 |
friend constexpr bool operator==(
|
| 99 |
-
const counted_iterator& x, default_sentinel_t);
|
| 100 |
|
| 101 |
template<common_with<I> I2>
|
| 102 |
friend constexpr strong_ordering operator<=>(
|
| 103 |
const counted_iterator& x, const counted_iterator<I2>& y);
|
| 104 |
|
| 105 |
-
friend constexpr
|
| 106 |
noexcept(noexcept(ranges::iter_move(i.current)))
|
| 107 |
requires input_iterator<I>;
|
| 108 |
template<indirectly_swappable<I> I2>
|
| 109 |
friend constexpr void iter_swap(const counted_iterator& x, const counted_iterator<I2>& y)
|
| 110 |
noexcept(noexcept(ranges::iter_swap(x.current, y.current)));
|
|
@@ -127,11 +127,11 @@ namespace std {
|
|
| 127 |
|
| 128 |
``` cpp
|
| 129 |
constexpr counted_iterator(I i, iter_difference_t<I> n);
|
| 130 |
```
|
| 131 |
|
| 132 |
-
|
| 133 |
|
| 134 |
*Effects:* Initializes `current` with `std::move(i)` and `length` with
|
| 135 |
`n`.
|
| 136 |
|
| 137 |
``` cpp
|
|
@@ -179,11 +179,11 @@ constexpr iter_difference_t<I> count() const noexcept;
|
|
| 179 |
constexpr decltype(auto) operator*();
|
| 180 |
constexpr decltype(auto) operator*() const
|
| 181 |
requires dereferenceable<const I>;
|
| 182 |
```
|
| 183 |
|
| 184 |
-
|
| 185 |
|
| 186 |
*Effects:* Equivalent to: `return *current;`
|
| 187 |
|
| 188 |
``` cpp
|
| 189 |
constexpr auto operator->() const noexcept
|
|
@@ -195,21 +195,21 @@ constexpr auto operator->() const noexcept
|
|
| 195 |
``` cpp
|
| 196 |
constexpr decltype(auto) operator[](iter_difference_t<I> n) const
|
| 197 |
requires random_access_iterator<I>;
|
| 198 |
```
|
| 199 |
|
| 200 |
-
|
| 201 |
|
| 202 |
*Effects:* Equivalent to: `return current[n];`
|
| 203 |
|
| 204 |
#### Navigation <a id="counted.iter.nav">[[counted.iter.nav]]</a>
|
| 205 |
|
| 206 |
``` cpp
|
| 207 |
constexpr counted_iterator& operator++();
|
| 208 |
```
|
| 209 |
|
| 210 |
-
|
| 211 |
|
| 212 |
*Effects:* Equivalent to:
|
| 213 |
|
| 214 |
``` cpp
|
| 215 |
++current;
|
|
@@ -219,11 +219,11 @@ return *this;
|
|
| 219 |
|
| 220 |
``` cpp
|
| 221 |
constexpr decltype(auto) operator++(int);
|
| 222 |
```
|
| 223 |
|
| 224 |
-
|
| 225 |
|
| 226 |
*Effects:* Equivalent to:
|
| 227 |
|
| 228 |
``` cpp
|
| 229 |
--length;
|
|
@@ -289,11 +289,11 @@ friend constexpr counted_iterator operator+(
|
|
| 289 |
``` cpp
|
| 290 |
constexpr counted_iterator& operator+=(iter_difference_t<I> n)
|
| 291 |
requires random_access_iterator<I>;
|
| 292 |
```
|
| 293 |
|
| 294 |
-
|
| 295 |
|
| 296 |
*Effects:* Equivalent to:
|
| 297 |
|
| 298 |
``` cpp
|
| 299 |
current += n;
|
|
@@ -320,28 +320,28 @@ sequence [[counted.iterator]].
|
|
| 320 |
|
| 321 |
*Effects:* Equivalent to: `return y.length - x.length;`
|
| 322 |
|
| 323 |
``` cpp
|
| 324 |
friend constexpr iter_difference_t<I> operator-(
|
| 325 |
-
const counted_iterator& x, default_sentinel_t);
|
| 326 |
```
|
| 327 |
|
| 328 |
*Effects:* Equivalent to: `return -x.length;`
|
| 329 |
|
| 330 |
``` cpp
|
| 331 |
friend constexpr iter_difference_t<I> operator-(
|
| 332 |
-
default_sentinel_t, const counted_iterator& y);
|
| 333 |
```
|
| 334 |
|
| 335 |
*Effects:* Equivalent to: `return y.length;`
|
| 336 |
|
| 337 |
``` cpp
|
| 338 |
constexpr counted_iterator& operator-=(iter_difference_t<I> n)
|
| 339 |
requires random_access_iterator<I>;
|
| 340 |
```
|
| 341 |
|
| 342 |
-
|
| 343 |
|
| 344 |
*Effects:* Equivalent to:
|
| 345 |
|
| 346 |
``` cpp
|
| 347 |
current -= n;
|
|
@@ -362,11 +362,11 @@ sequence [[counted.iterator]].
|
|
| 362 |
|
| 363 |
*Effects:* Equivalent to: `return x.length == y.length;`
|
| 364 |
|
| 365 |
``` cpp
|
| 366 |
friend constexpr bool operator==(
|
| 367 |
-
const counted_iterator& x, default_sentinel_t);
|
| 368 |
```
|
| 369 |
|
| 370 |
*Effects:* Equivalent to: `return x.length == 0;`
|
| 371 |
|
| 372 |
``` cpp
|
|
@@ -384,26 +384,26 @@ sequence [[counted.iterator]].
|
|
| 384 |
because `length` counts down, not up. — *end note*]
|
| 385 |
|
| 386 |
#### Customizations <a id="counted.iter.cust">[[counted.iter.cust]]</a>
|
| 387 |
|
| 388 |
``` cpp
|
| 389 |
-
friend constexpr
|
| 390 |
iter_move(const counted_iterator& i)
|
| 391 |
noexcept(noexcept(ranges::iter_move(i.current)))
|
| 392 |
requires input_iterator<I>;
|
| 393 |
```
|
| 394 |
|
| 395 |
-
|
| 396 |
|
| 397 |
*Effects:* Equivalent to: `return ranges::iter_move(i.current);`
|
| 398 |
|
| 399 |
``` cpp
|
| 400 |
template<indirectly_swappable<I> I2>
|
| 401 |
friend constexpr void
|
| 402 |
iter_swap(const counted_iterator& x, const counted_iterator<I2>& y)
|
| 403 |
noexcept(noexcept(ranges::iter_swap(x.current, y.current)));
|
| 404 |
```
|
| 405 |
|
| 406 |
-
|
| 407 |
|
| 408 |
*Effects:* Equivalent to `ranges::iter_swap(x.current, y.current)`.
|
| 409 |
|
|
|
|
| 34 |
public:
|
| 35 |
using iterator_type = I;
|
| 36 |
using value_type = iter_value_t<I>; // present only
|
| 37 |
// if I models indirectly_readable
|
| 38 |
using difference_type = iter_difference_t<I>;
|
| 39 |
+
using iterator_concept = I::iterator_concept; // present only
|
| 40 |
// if the qualified-id I::iterator_concept is valid and denotes a type
|
| 41 |
+
using iterator_category = I::iterator_category; // present only
|
| 42 |
// if the qualified-id I::iterator_category is valid and denotes a type
|
| 43 |
constexpr counted_iterator() requires default_initializable<I> = default;
|
| 44 |
constexpr counted_iterator(I x, iter_difference_t<I> n);
|
| 45 |
template<class I2>
|
| 46 |
requires convertible_to<const I2&, I>
|
|
|
|
| 81 |
requires random_access_iterator<I>;
|
| 82 |
template<common_with<I> I2>
|
| 83 |
friend constexpr iter_difference_t<I2> operator-(
|
| 84 |
const counted_iterator& x, const counted_iterator<I2>& y);
|
| 85 |
friend constexpr iter_difference_t<I> operator-(
|
| 86 |
+
const counted_iterator& x, default_sentinel_t) noexcept;
|
| 87 |
friend constexpr iter_difference_t<I> operator-(
|
| 88 |
+
default_sentinel_t, const counted_iterator& y) noexcept;
|
| 89 |
constexpr counted_iterator& operator-=(iter_difference_t<I> n)
|
| 90 |
requires random_access_iterator<I>;
|
| 91 |
|
| 92 |
constexpr decltype(auto) operator[](iter_difference_t<I> n) const
|
| 93 |
requires random_access_iterator<I>;
|
| 94 |
|
| 95 |
template<common_with<I> I2>
|
| 96 |
friend constexpr bool operator==(
|
| 97 |
const counted_iterator& x, const counted_iterator<I2>& y);
|
| 98 |
friend constexpr bool operator==(
|
| 99 |
+
const counted_iterator& x, default_sentinel_t) noexcept;
|
| 100 |
|
| 101 |
template<common_with<I> I2>
|
| 102 |
friend constexpr strong_ordering operator<=>(
|
| 103 |
const counted_iterator& x, const counted_iterator<I2>& y);
|
| 104 |
|
| 105 |
+
friend constexpr decltype(auto) iter_move(const counted_iterator& i)
|
| 106 |
noexcept(noexcept(ranges::iter_move(i.current)))
|
| 107 |
requires input_iterator<I>;
|
| 108 |
template<indirectly_swappable<I> I2>
|
| 109 |
friend constexpr void iter_swap(const counted_iterator& x, const counted_iterator<I2>& y)
|
| 110 |
noexcept(noexcept(ranges::iter_swap(x.current, y.current)));
|
|
|
|
| 127 |
|
| 128 |
``` cpp
|
| 129 |
constexpr counted_iterator(I i, iter_difference_t<I> n);
|
| 130 |
```
|
| 131 |
|
| 132 |
+
`n >= 0` is `true`.
|
| 133 |
|
| 134 |
*Effects:* Initializes `current` with `std::move(i)` and `length` with
|
| 135 |
`n`.
|
| 136 |
|
| 137 |
``` cpp
|
|
|
|
| 179 |
constexpr decltype(auto) operator*();
|
| 180 |
constexpr decltype(auto) operator*() const
|
| 181 |
requires dereferenceable<const I>;
|
| 182 |
```
|
| 183 |
|
| 184 |
+
`length > 0` is `true`.
|
| 185 |
|
| 186 |
*Effects:* Equivalent to: `return *current;`
|
| 187 |
|
| 188 |
``` cpp
|
| 189 |
constexpr auto operator->() const noexcept
|
|
|
|
| 195 |
``` cpp
|
| 196 |
constexpr decltype(auto) operator[](iter_difference_t<I> n) const
|
| 197 |
requires random_access_iterator<I>;
|
| 198 |
```
|
| 199 |
|
| 200 |
+
`n < length` is `true`.
|
| 201 |
|
| 202 |
*Effects:* Equivalent to: `return current[n];`
|
| 203 |
|
| 204 |
#### Navigation <a id="counted.iter.nav">[[counted.iter.nav]]</a>
|
| 205 |
|
| 206 |
``` cpp
|
| 207 |
constexpr counted_iterator& operator++();
|
| 208 |
```
|
| 209 |
|
| 210 |
+
`length > 0` is `true`.
|
| 211 |
|
| 212 |
*Effects:* Equivalent to:
|
| 213 |
|
| 214 |
``` cpp
|
| 215 |
++current;
|
|
|
|
| 219 |
|
| 220 |
``` cpp
|
| 221 |
constexpr decltype(auto) operator++(int);
|
| 222 |
```
|
| 223 |
|
| 224 |
+
`length > 0` is `true`.
|
| 225 |
|
| 226 |
*Effects:* Equivalent to:
|
| 227 |
|
| 228 |
``` cpp
|
| 229 |
--length;
|
|
|
|
| 289 |
``` cpp
|
| 290 |
constexpr counted_iterator& operator+=(iter_difference_t<I> n)
|
| 291 |
requires random_access_iterator<I>;
|
| 292 |
```
|
| 293 |
|
| 294 |
+
`n <= length` is `true`.
|
| 295 |
|
| 296 |
*Effects:* Equivalent to:
|
| 297 |
|
| 298 |
``` cpp
|
| 299 |
current += n;
|
|
|
|
| 320 |
|
| 321 |
*Effects:* Equivalent to: `return y.length - x.length;`
|
| 322 |
|
| 323 |
``` cpp
|
| 324 |
friend constexpr iter_difference_t<I> operator-(
|
| 325 |
+
const counted_iterator& x, default_sentinel_t) noexcept;
|
| 326 |
```
|
| 327 |
|
| 328 |
*Effects:* Equivalent to: `return -x.length;`
|
| 329 |
|
| 330 |
``` cpp
|
| 331 |
friend constexpr iter_difference_t<I> operator-(
|
| 332 |
+
default_sentinel_t, const counted_iterator& y) noexcept;
|
| 333 |
```
|
| 334 |
|
| 335 |
*Effects:* Equivalent to: `return y.length;`
|
| 336 |
|
| 337 |
``` cpp
|
| 338 |
constexpr counted_iterator& operator-=(iter_difference_t<I> n)
|
| 339 |
requires random_access_iterator<I>;
|
| 340 |
```
|
| 341 |
|
| 342 |
+
`-n <= length` is `true`.
|
| 343 |
|
| 344 |
*Effects:* Equivalent to:
|
| 345 |
|
| 346 |
``` cpp
|
| 347 |
current -= n;
|
|
|
|
| 362 |
|
| 363 |
*Effects:* Equivalent to: `return x.length == y.length;`
|
| 364 |
|
| 365 |
``` cpp
|
| 366 |
friend constexpr bool operator==(
|
| 367 |
+
const counted_iterator& x, default_sentinel_t) noexcept;
|
| 368 |
```
|
| 369 |
|
| 370 |
*Effects:* Equivalent to: `return x.length == 0;`
|
| 371 |
|
| 372 |
``` cpp
|
|
|
|
| 384 |
because `length` counts down, not up. — *end note*]
|
| 385 |
|
| 386 |
#### Customizations <a id="counted.iter.cust">[[counted.iter.cust]]</a>
|
| 387 |
|
| 388 |
``` cpp
|
| 389 |
+
friend constexpr decltype(auto)
|
| 390 |
iter_move(const counted_iterator& i)
|
| 391 |
noexcept(noexcept(ranges::iter_move(i.current)))
|
| 392 |
requires input_iterator<I>;
|
| 393 |
```
|
| 394 |
|
| 395 |
+
`i.length > 0` is `true`.
|
| 396 |
|
| 397 |
*Effects:* Equivalent to: `return ranges::iter_move(i.current);`
|
| 398 |
|
| 399 |
``` cpp
|
| 400 |
template<indirectly_swappable<I> I2>
|
| 401 |
friend constexpr void
|
| 402 |
iter_swap(const counted_iterator& x, const counted_iterator<I2>& y)
|
| 403 |
noexcept(noexcept(ranges::iter_swap(x.current, y.current)));
|
| 404 |
```
|
| 405 |
|
| 406 |
+
Both `x.length > 0` and `y.length > 0` are `true`.
|
| 407 |
|
| 408 |
*Effects:* Equivalent to `ranges::iter_swap(x.current, y.current)`.
|
| 409 |
|