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