tmp/tmpk5kem08t/{from.md → to.md}
RENAMED
|
@@ -5,35 +5,34 @@ namespace std::ranges {
|
|
| 5 |
template<view V, class Pred>
|
| 6 |
requires input_range<V> && is_object_v<Pred> &&
|
| 7 |
indirect_unary_predicate<const Pred, iterator_t<V>>
|
| 8 |
class drop_while_view : public view_interface<drop_while_view<V, Pred>> {
|
| 9 |
public:
|
| 10 |
-
drop_while_view() = default;
|
| 11 |
-
constexpr drop_while_view(V base, Pred pred);
|
| 12 |
|
| 13 |
constexpr V base() const & requires copy_constructible<V> { return base_; }
|
| 14 |
constexpr V base() && { return std::move(base_); }
|
| 15 |
|
| 16 |
constexpr const Pred& pred() const;
|
| 17 |
|
| 18 |
constexpr auto begin();
|
| 19 |
|
| 20 |
-
constexpr auto end()
|
| 21 |
-
{ return ranges::end(base_); }
|
| 22 |
|
| 23 |
private:
|
| 24 |
V base_ = V(); // exposition only
|
| 25 |
-
|
| 26 |
};
|
| 27 |
|
| 28 |
template<class R, class Pred>
|
| 29 |
drop_while_view(R&&, Pred) -> drop_while_view<views::all_t<R>, Pred>;
|
| 30 |
}
|
| 31 |
```
|
| 32 |
|
| 33 |
``` cpp
|
| 34 |
-
constexpr drop_while_view(V base, Pred pred);
|
| 35 |
```
|
| 36 |
|
| 37 |
*Effects:* Initializes *base\_* with `std::move(base)` and *pred\_* with
|
| 38 |
`std::move(pred)`.
|
| 39 |
|
|
@@ -45,11 +44,13 @@ constexpr const Pred& pred() const;
|
|
| 45 |
|
| 46 |
``` cpp
|
| 47 |
constexpr auto begin();
|
| 48 |
```
|
| 49 |
|
| 50 |
-
*
|
|
|
|
|
|
|
| 51 |
|
| 52 |
*Remarks:* In order to provide the amortized constant-time complexity
|
| 53 |
required by the `range` concept when `drop_while_view` models
|
| 54 |
`forward_range`, the first call caches the result within the
|
| 55 |
`drop_while_view` for use on subsequent calls.
|
|
|
|
| 5 |
template<view V, class Pred>
|
| 6 |
requires input_range<V> && is_object_v<Pred> &&
|
| 7 |
indirect_unary_predicate<const Pred, iterator_t<V>>
|
| 8 |
class drop_while_view : public view_interface<drop_while_view<V, Pred>> {
|
| 9 |
public:
|
| 10 |
+
drop_while_view() requires default_initializable<V> && default_initializable<Pred> = default;
|
| 11 |
+
constexpr explicit drop_while_view(V base, Pred pred);
|
| 12 |
|
| 13 |
constexpr V base() const & requires copy_constructible<V> { return base_; }
|
| 14 |
constexpr V base() && { return std::move(base_); }
|
| 15 |
|
| 16 |
constexpr const Pred& pred() const;
|
| 17 |
|
| 18 |
constexpr auto begin();
|
| 19 |
|
| 20 |
+
constexpr auto end() { return ranges::end(base_); }
|
|
|
|
| 21 |
|
| 22 |
private:
|
| 23 |
V base_ = V(); // exposition only
|
| 24 |
+
movable-box<Pred> pred_; // exposition only
|
| 25 |
};
|
| 26 |
|
| 27 |
template<class R, class Pred>
|
| 28 |
drop_while_view(R&&, Pred) -> drop_while_view<views::all_t<R>, Pred>;
|
| 29 |
}
|
| 30 |
```
|
| 31 |
|
| 32 |
``` cpp
|
| 33 |
+
constexpr explicit drop_while_view(V base, Pred pred);
|
| 34 |
```
|
| 35 |
|
| 36 |
*Effects:* Initializes *base\_* with `std::move(base)` and *pred\_* with
|
| 37 |
`std::move(pred)`.
|
| 38 |
|
|
|
|
| 44 |
|
| 45 |
``` cpp
|
| 46 |
constexpr auto begin();
|
| 47 |
```
|
| 48 |
|
| 49 |
+
*Preconditions:* *`pred_`*`.has_value()` is `true`.
|
| 50 |
+
|
| 51 |
+
*Returns:* `ranges::find_if_not(`*`base_`*`, cref(*`*`pred_`*`))`.
|
| 52 |
|
| 53 |
*Remarks:* In order to provide the amortized constant-time complexity
|
| 54 |
required by the `range` concept when `drop_while_view` models
|
| 55 |
`forward_range`, the first call caches the result within the
|
| 56 |
`drop_while_view` for use on subsequent calls.
|