tmp/tmp1105c61q/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Class `chunk_view::inner-iterator` <a id="range.chunk.inner.iter">[[range.chunk.inner.iter]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std::ranges {
|
| 5 |
+
template<view V>
|
| 6 |
+
requires input_range<V>
|
| 7 |
+
class chunk_view<V>::inner-iterator {
|
| 8 |
+
chunk_view* parent_; // exposition only
|
| 9 |
+
|
| 10 |
+
constexpr explicit inner-iterator(chunk_view& parent) noexcept; // exposition only
|
| 11 |
+
|
| 12 |
+
public:
|
| 13 |
+
using iterator_concept = input_iterator_tag;
|
| 14 |
+
using difference_type = range_difference_t<V>;
|
| 15 |
+
using value_type = range_value_t<V>;
|
| 16 |
+
|
| 17 |
+
inner-iterator(inner-iterator&&) = default;
|
| 18 |
+
inner-iterator& operator=(inner-iterator&&) = default;
|
| 19 |
+
|
| 20 |
+
constexpr const iterator_t<V>& base() const &;
|
| 21 |
+
|
| 22 |
+
constexpr range_reference_t<V> operator*() const;
|
| 23 |
+
constexpr inner-iterator& operator++();
|
| 24 |
+
constexpr void operator++(int);
|
| 25 |
+
|
| 26 |
+
friend constexpr bool operator==(const inner-iterator& x, default_sentinel_t);
|
| 27 |
+
|
| 28 |
+
friend constexpr difference_type operator-(default_sentinel_t y, const inner-iterator& x)
|
| 29 |
+
requires sized_sentinel_for<sentinel_t<V>, iterator_t<V>>;
|
| 30 |
+
friend constexpr difference_type operator-(const inner-iterator& x, default_sentinel_t y)
|
| 31 |
+
requires sized_sentinel_for<sentinel_t<V>, iterator_t<V>>;
|
| 32 |
+
|
| 33 |
+
friend constexpr range_rvalue_reference_t<V> iter_move(const inner-iterator& i)
|
| 34 |
+
noexcept(noexcept(ranges::iter_move(*i.parent_->current_)));
|
| 35 |
+
|
| 36 |
+
friend constexpr void iter_swap(const inner-iterator& x, const inner-iterator& y)
|
| 37 |
+
noexcept(noexcept(ranges::iter_swap(*x.parent_->current_, *y.parent_->current_)))
|
| 38 |
+
requires indirectly_swappable<iterator_t<V>>;
|
| 39 |
+
};
|
| 40 |
+
}
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
``` cpp
|
| 44 |
+
constexpr explicit inner-iterator(chunk_view& parent) noexcept;
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
*Effects:* Initializes *parent\_* with `addressof(parent)`.
|
| 48 |
+
|
| 49 |
+
``` cpp
|
| 50 |
+
constexpr const iterator_t<V>& base() const &;
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
*Effects:* Equivalent to: `return *`*`parent_`*`->`*`current_`*`;`
|
| 54 |
+
|
| 55 |
+
``` cpp
|
| 56 |
+
constexpr range_reference_t<V> operator*() const;
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
*Preconditions:* `*this == default_sentinel` is `false`.
|
| 60 |
+
|
| 61 |
+
*Effects:* Equivalent to: `return **`*`parent_`*`->`*`current_`*`;`
|
| 62 |
+
|
| 63 |
+
``` cpp
|
| 64 |
+
constexpr inner-iterator& operator++();
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
*Preconditions:* `*this == default_sentinel` is `false`.
|
| 68 |
+
|
| 69 |
+
*Effects:* Equivalent to:
|
| 70 |
+
|
| 71 |
+
``` cpp
|
| 72 |
+
++*parent_->current_;
|
| 73 |
+
if (*parent_->current_ == ranges::end(parent_->base_))
|
| 74 |
+
parent_->remainder_ = 0;
|
| 75 |
+
else
|
| 76 |
+
--parent_->remainder_;
|
| 77 |
+
return *this;
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
``` cpp
|
| 81 |
+
constexpr void operator++(int);
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
*Effects:* Equivalent to `++*this`.
|
| 85 |
+
|
| 86 |
+
``` cpp
|
| 87 |
+
friend constexpr bool operator==(const inner-iterator& x, default_sentinel_t);
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
*Returns:* `x.`*`parent_`*`->`*`remainder_`*` == 0`.
|
| 91 |
+
|
| 92 |
+
``` cpp
|
| 93 |
+
friend constexpr difference_type operator-(default_sentinel_t y, const inner-iterator& x)
|
| 94 |
+
requires sized_sentinel_for<sentinel_t<V>, iterator_t<V>>;
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
*Effects:* Equivalent to:
|
| 98 |
+
|
| 99 |
+
``` cpp
|
| 100 |
+
return ranges::min(x.parent_->remainder_,
|
| 101 |
+
ranges::end(x.parent_->base_) - *x.parent_->current_);
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
``` cpp
|
| 105 |
+
friend constexpr difference_type operator-(const inner-iterator& x, default_sentinel_t y)
|
| 106 |
+
requires sized_sentinel_for<sentinel_t<V>, iterator_t<V>>;
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
*Effects:* Equivalent to: `return -(y - x);`
|
| 110 |
+
|
| 111 |
+
``` cpp
|
| 112 |
+
friend constexpr range_rvalue_reference_t<V> iter_move(const inner-iterator& i)
|
| 113 |
+
noexcept(noexcept(ranges::iter_move(*i.parent_->current_)));
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
*Effects:* Equivalent to:
|
| 117 |
+
`return ranges::iter_move(*i.`*`parent_`*`->`*`current_`*`);`
|
| 118 |
+
|
| 119 |
+
``` cpp
|
| 120 |
+
friend constexpr void iter_swap(const inner-iterator& x, const inner-iterator& y)
|
| 121 |
+
noexcept(noexcept(ranges::iter_swap(*x.parent_->current_, *y.parent_->current_)))
|
| 122 |
+
requires indirectly_swappable<iterator_t<V>>;
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
*Effects:* Equivalent to:
|
| 126 |
+
`ranges::iter_swap(*x.`*`parent_`*`->`*`current_`*`, *y.`*`parent_`*`->`*`current_`*`);`
|
| 127 |
+
|