tmp/tmpg2dstrwk/{from.md → to.md}
RENAMED
|
@@ -8,41 +8,45 @@ namespace std::ranges {
|
|
| 8 |
class take_while_view : public view_interface<take_while_view<V, Pred>> {
|
| 9 |
// [range.take.while.sentinel], class template take_while_view::sentinel
|
| 10 |
template<bool> class sentinel; // exposition only
|
| 11 |
|
| 12 |
V base_ = V(); // exposition only
|
| 13 |
-
|
| 14 |
|
| 15 |
public:
|
| 16 |
-
take_while_view() = default;
|
| 17 |
-
constexpr take_while_view(V base, Pred pred);
|
| 18 |
|
| 19 |
constexpr V base() const & requires copy_constructible<V> { return base_; }
|
| 20 |
constexpr V base() && { return std::move(base_); }
|
| 21 |
|
| 22 |
constexpr const Pred& pred() const;
|
| 23 |
|
| 24 |
constexpr auto begin() requires (!simple-view<V>)
|
| 25 |
{ return ranges::begin(base_); }
|
| 26 |
|
| 27 |
-
constexpr auto begin() const
|
|
|
|
|
|
|
| 28 |
{ return ranges::begin(base_); }
|
| 29 |
|
| 30 |
constexpr auto end() requires (!simple-view<V>)
|
| 31 |
{ return sentinel<false>(ranges::end(base_), addressof(*pred_)); }
|
| 32 |
|
| 33 |
-
constexpr auto end() const
|
|
|
|
|
|
|
| 34 |
{ return sentinel<true>(ranges::end(base_), addressof(*pred_)); }
|
| 35 |
};
|
| 36 |
|
| 37 |
template<class R, class Pred>
|
| 38 |
take_while_view(R&&, Pred) -> take_while_view<views::all_t<R>, Pred>;
|
| 39 |
}
|
| 40 |
```
|
| 41 |
|
| 42 |
``` cpp
|
| 43 |
-
constexpr take_while_view(V base, Pred pred);
|
| 44 |
```
|
| 45 |
|
| 46 |
*Effects:* Initializes *base\_* with `std::move(base)` and *pred\_* with
|
| 47 |
`std::move(pred)`.
|
| 48 |
|
|
|
|
| 8 |
class take_while_view : public view_interface<take_while_view<V, Pred>> {
|
| 9 |
// [range.take.while.sentinel], class template take_while_view::sentinel
|
| 10 |
template<bool> class sentinel; // exposition only
|
| 11 |
|
| 12 |
V base_ = V(); // exposition only
|
| 13 |
+
movable-box<Pred> pred_; // exposition only
|
| 14 |
|
| 15 |
public:
|
| 16 |
+
take_while_view() requires default_initializable<V> && default_initializable<Pred> = default;
|
| 17 |
+
constexpr explicit take_while_view(V base, Pred pred);
|
| 18 |
|
| 19 |
constexpr V base() const & requires copy_constructible<V> { return base_; }
|
| 20 |
constexpr V base() && { return std::move(base_); }
|
| 21 |
|
| 22 |
constexpr const Pred& pred() const;
|
| 23 |
|
| 24 |
constexpr auto begin() requires (!simple-view<V>)
|
| 25 |
{ return ranges::begin(base_); }
|
| 26 |
|
| 27 |
+
constexpr auto begin() const
|
| 28 |
+
requires range<const V> &&
|
| 29 |
+
indirect_unary_predicate<const Pred, iterator_t<const V>>
|
| 30 |
{ return ranges::begin(base_); }
|
| 31 |
|
| 32 |
constexpr auto end() requires (!simple-view<V>)
|
| 33 |
{ return sentinel<false>(ranges::end(base_), addressof(*pred_)); }
|
| 34 |
|
| 35 |
+
constexpr auto end() const
|
| 36 |
+
requires range<const V> &&
|
| 37 |
+
indirect_unary_predicate<const Pred, iterator_t<const V>>
|
| 38 |
{ return sentinel<true>(ranges::end(base_), addressof(*pred_)); }
|
| 39 |
};
|
| 40 |
|
| 41 |
template<class R, class Pred>
|
| 42 |
take_while_view(R&&, Pred) -> take_while_view<views::all_t<R>, Pred>;
|
| 43 |
}
|
| 44 |
```
|
| 45 |
|
| 46 |
``` cpp
|
| 47 |
+
constexpr explicit take_while_view(V base, Pred pred);
|
| 48 |
```
|
| 49 |
|
| 50 |
*Effects:* Initializes *base\_* with `std::move(base)` and *pred\_* with
|
| 51 |
`std::move(pred)`.
|
| 52 |
|