tmp/tmpsqmxriuv/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Class template `to_input_view` <a id="range.to.input.view">[[range.to.input.view]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std::ranges {
|
| 5 |
+
template<input_range V>
|
| 6 |
+
requires view<V>
|
| 7 |
+
class to_input_view : public view_interface<to_input_view<V>> {
|
| 8 |
+
V base_ = V(); // exposition only
|
| 9 |
+
|
| 10 |
+
// [range.to.input.iterator], class template to_input_view::iterator
|
| 11 |
+
template<bool Const> class iterator; // exposition only
|
| 12 |
+
|
| 13 |
+
public:
|
| 14 |
+
to_input_view() requires default_initializable<V> = default;
|
| 15 |
+
constexpr explicit to_input_view(V base);
|
| 16 |
+
|
| 17 |
+
constexpr V base() const & requires copy_constructible<V> { return base_; }
|
| 18 |
+
constexpr V base() && { return std::move(base_); }
|
| 19 |
+
|
| 20 |
+
constexpr auto begin() requires (!simple-view<V>);
|
| 21 |
+
constexpr auto begin() const requires range<const V>;
|
| 22 |
+
|
| 23 |
+
constexpr auto end() requires (!simple-view<V>);
|
| 24 |
+
constexpr auto end() const requires range<const V>;
|
| 25 |
+
|
| 26 |
+
constexpr auto size() requires sized_range<V>;
|
| 27 |
+
constexpr auto size() const requires sized_range<const V>;
|
| 28 |
+
|
| 29 |
+
constexpr auto reserve_hint() requires approximately_sized_range<V>;
|
| 30 |
+
constexpr auto reserve_hint() const requires approximately_sized_range<const V>;
|
| 31 |
+
};
|
| 32 |
+
|
| 33 |
+
template<class R>
|
| 34 |
+
to_input_view(R&&) -> to_input_view<views::all_t<R>>;
|
| 35 |
+
}
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
``` cpp
|
| 39 |
+
constexpr explicit to_input_view(V base);
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
*Effects:* Initializes *base\_* with `std::move(base)`.
|
| 43 |
+
|
| 44 |
+
``` cpp
|
| 45 |
+
constexpr auto begin() requires (!simple-view<V>);
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
*Effects:* Equivalent to:
|
| 49 |
+
`return `*`iterator`*`<false>(ranges::begin(`*`base_`*`));`
|
| 50 |
+
|
| 51 |
+
``` cpp
|
| 52 |
+
constexpr auto begin() const requires range<const V>;
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
*Effects:* Equivalent to:
|
| 56 |
+
`return `*`iterator`*`<true>(ranges::begin(`*`base_`*`));`
|
| 57 |
+
|
| 58 |
+
``` cpp
|
| 59 |
+
constexpr auto end() requires (!simple-view<V>);
|
| 60 |
+
constexpr auto end() const requires range<const V>;
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
*Effects:* Equivalent to: `return ranges::end(`*`base_`*`);`
|
| 64 |
+
|
| 65 |
+
``` cpp
|
| 66 |
+
constexpr auto size() requires sized_range<V>;
|
| 67 |
+
constexpr auto size() const requires sized_range<const V>;
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
*Effects:* Equivalent to: `return ranges::size(`*`base_`*`);`
|
| 71 |
+
|
| 72 |
+
``` cpp
|
| 73 |
+
constexpr auto reserve_hint() requires approximately_sized_range<V>;
|
| 74 |
+
constexpr auto reserve_hint() const requires approximately_sized_range<const V>;
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
*Effects:* Equivalent to: `return ranges::reserve_hint(`*`base_`*`);`
|
| 78 |
+
|