tmp/tmpg48ktvf_/{from.md → to.md}
RENAMED
|
@@ -6,21 +6,21 @@ namespace std::ranges {
|
|
| 6 |
requires view<V> && is_object_v<Pred>
|
| 7 |
class filter_view<V, Pred>::iterator {
|
| 8 |
private:
|
| 9 |
iterator_t<V> current_ = iterator_t<V>(); // exposition only
|
| 10 |
filter_view* parent_ = nullptr; // exposition only
|
|
|
|
| 11 |
public:
|
| 12 |
-
using iterator_concept = see
|
| 13 |
-
using iterator_category = see
|
| 14 |
using value_type = range_value_t<V>;
|
| 15 |
using difference_type = range_difference_t<V>;
|
| 16 |
|
| 17 |
-
iterator() = default;
|
| 18 |
constexpr iterator(filter_view& parent, iterator_t<V> current);
|
| 19 |
|
| 20 |
-
constexpr iterator_t<V> base() const &
|
| 21 |
-
requires copyable<iterator_t<V>>;
|
| 22 |
constexpr iterator_t<V> base() &&;
|
| 23 |
constexpr range_reference_t<V> operator*() const;
|
| 24 |
constexpr iterator_t<V> operator->() const
|
| 25 |
requires has-arrow<iterator_t<V>> && copyable<iterator_t<V>>;
|
| 26 |
|
|
@@ -34,10 +34,11 @@ namespace std::ranges {
|
|
| 34 |
friend constexpr bool operator==(const iterator& x, const iterator& y)
|
| 35 |
requires equality_comparable<iterator_t<V>>;
|
| 36 |
|
| 37 |
friend constexpr range_rvalue_reference_t<V> iter_move(const iterator& i)
|
| 38 |
noexcept(noexcept(ranges::iter_move(i.current_)));
|
|
|
|
| 39 |
friend constexpr void iter_swap(const iterator& x, const iterator& y)
|
| 40 |
noexcept(noexcept(ranges::iter_swap(x.current_, y.current_)))
|
| 41 |
requires indirectly_swappable<iterator_t<V>>;
|
| 42 |
};
|
| 43 |
}
|
|
@@ -53,11 +54,13 @@ not satisfy the filter predicate.
|
|
| 53 |
`bidirectional_iterator_tag`.
|
| 54 |
- Otherwise, if `V` models `forward_range`, then `iterator_concept`
|
| 55 |
denotes `forward_iterator_tag`.
|
| 56 |
- Otherwise, `iterator_concept` denotes `input_iterator_tag`.
|
| 57 |
|
| 58 |
-
`
|
|
|
|
|
|
|
| 59 |
|
| 60 |
- Let `C` denote the type
|
| 61 |
`iterator_traits<iterator_t<V>>::iterator_category`.
|
| 62 |
- If `C` models `derived_from<bidirectional_iterator_tag>`, then
|
| 63 |
`iterator_category` denotes `bidirectional_iterator_tag`.
|
|
@@ -71,21 +74,20 @@ constexpr iterator(filter_view& parent, iterator_t<V> current);
|
|
| 71 |
|
| 72 |
*Effects:* Initializes *current\_* with `std::move(current)` and
|
| 73 |
*parent\_* with `addressof(parent)`.
|
| 74 |
|
| 75 |
``` cpp
|
| 76 |
-
constexpr iterator_t<V> base() const &
|
| 77 |
-
requires copyable<iterator_t<V>>;
|
| 78 |
```
|
| 79 |
|
| 80 |
*Effects:* Equivalent to: `return `*`current_`*`;`
|
| 81 |
|
| 82 |
``` cpp
|
| 83 |
constexpr iterator_t<V> base() &&;
|
| 84 |
```
|
| 85 |
|
| 86 |
-
*Effects:* Equivalent to: `return std::move(current_);`
|
| 87 |
|
| 88 |
``` cpp
|
| 89 |
constexpr range_reference_t<V> operator*() const;
|
| 90 |
```
|
| 91 |
|
|
|
|
| 6 |
requires view<V> && is_object_v<Pred>
|
| 7 |
class filter_view<V, Pred>::iterator {
|
| 8 |
private:
|
| 9 |
iterator_t<V> current_ = iterator_t<V>(); // exposition only
|
| 10 |
filter_view* parent_ = nullptr; // exposition only
|
| 11 |
+
|
| 12 |
public:
|
| 13 |
+
using iterator_concept = see belownc;
|
| 14 |
+
using iterator_category = see belownc; // not always present
|
| 15 |
using value_type = range_value_t<V>;
|
| 16 |
using difference_type = range_difference_t<V>;
|
| 17 |
|
| 18 |
+
iterator() requires default_initializable<iterator_t<V>> = default;
|
| 19 |
constexpr iterator(filter_view& parent, iterator_t<V> current);
|
| 20 |
|
| 21 |
+
constexpr const iterator_t<V>& base() const & noexcept;
|
|
|
|
| 22 |
constexpr iterator_t<V> base() &&;
|
| 23 |
constexpr range_reference_t<V> operator*() const;
|
| 24 |
constexpr iterator_t<V> operator->() const
|
| 25 |
requires has-arrow<iterator_t<V>> && copyable<iterator_t<V>>;
|
| 26 |
|
|
|
|
| 34 |
friend constexpr bool operator==(const iterator& x, const iterator& y)
|
| 35 |
requires equality_comparable<iterator_t<V>>;
|
| 36 |
|
| 37 |
friend constexpr range_rvalue_reference_t<V> iter_move(const iterator& i)
|
| 38 |
noexcept(noexcept(ranges::iter_move(i.current_)));
|
| 39 |
+
|
| 40 |
friend constexpr void iter_swap(const iterator& x, const iterator& y)
|
| 41 |
noexcept(noexcept(ranges::iter_swap(x.current_, y.current_)))
|
| 42 |
requires indirectly_swappable<iterator_t<V>>;
|
| 43 |
};
|
| 44 |
}
|
|
|
|
| 54 |
`bidirectional_iterator_tag`.
|
| 55 |
- Otherwise, if `V` models `forward_range`, then `iterator_concept`
|
| 56 |
denotes `forward_iterator_tag`.
|
| 57 |
- Otherwise, `iterator_concept` denotes `input_iterator_tag`.
|
| 58 |
|
| 59 |
+
The member *typedef-name* `iterator_category` is defined if and only if
|
| 60 |
+
`V` models `forward_range`. In that case, `iterator::iterator_category`
|
| 61 |
+
is defined as follows:
|
| 62 |
|
| 63 |
- Let `C` denote the type
|
| 64 |
`iterator_traits<iterator_t<V>>::iterator_category`.
|
| 65 |
- If `C` models `derived_from<bidirectional_iterator_tag>`, then
|
| 66 |
`iterator_category` denotes `bidirectional_iterator_tag`.
|
|
|
|
| 74 |
|
| 75 |
*Effects:* Initializes *current\_* with `std::move(current)` and
|
| 76 |
*parent\_* with `addressof(parent)`.
|
| 77 |
|
| 78 |
``` cpp
|
| 79 |
+
constexpr const iterator_t<V>& base() const & noexcept;
|
|
|
|
| 80 |
```
|
| 81 |
|
| 82 |
*Effects:* Equivalent to: `return `*`current_`*`;`
|
| 83 |
|
| 84 |
``` cpp
|
| 85 |
constexpr iterator_t<V> base() &&;
|
| 86 |
```
|
| 87 |
|
| 88 |
+
*Effects:* Equivalent to: `return std::move(`*`current_`*`);`
|
| 89 |
|
| 90 |
``` cpp
|
| 91 |
constexpr range_reference_t<V> operator*() const;
|
| 92 |
```
|
| 93 |
|