tmp/tmpegg8fpiy/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Class template `zip_view::sentinel` <a id="range.zip.sentinel">[[range.zip.sentinel]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std::ranges {
|
| 5 |
+
template<input_range... Views>
|
| 6 |
+
requires (view<Views> && ...) && (sizeof...(Views) > 0)
|
| 7 |
+
template<bool Const>
|
| 8 |
+
class zip_view<Views...>::sentinel {
|
| 9 |
+
tuple<sentinel_t<maybe-const<Const, Views>>...> end_; // exposition only
|
| 10 |
+
constexpr explicit sentinel(tuple<sentinel_t<maybe-const<Const, Views>>...> end);
|
| 11 |
+
// exposition only
|
| 12 |
+
public:
|
| 13 |
+
sentinel() = default;
|
| 14 |
+
constexpr sentinel(sentinel<!Const> i)
|
| 15 |
+
requires Const && (convertible_to<sentinel_t<Views>, sentinel_t<const Views>> && ...);
|
| 16 |
+
|
| 17 |
+
template<bool OtherConst>
|
| 18 |
+
requires (sentinel_for<sentinel_t<maybe-const<Const, Views>>,
|
| 19 |
+
iterator_t<maybe-const<OtherConst, Views>>> && ...)
|
| 20 |
+
friend constexpr bool operator==(const iterator<OtherConst>& x, const sentinel& y);
|
| 21 |
+
|
| 22 |
+
template<bool OtherConst>
|
| 23 |
+
requires (sized_sentinel_for<sentinel_t<maybe-const<Const, Views>>,
|
| 24 |
+
iterator_t<maybe-const<OtherConst, Views>>> && ...)
|
| 25 |
+
friend constexpr common_type_t<range_difference_t<maybe-const<OtherConst, Views>>...>
|
| 26 |
+
operator-(const iterator<OtherConst>& x, const sentinel& y);
|
| 27 |
+
|
| 28 |
+
template<bool OtherConst>
|
| 29 |
+
requires (sized_sentinel_for<sentinel_t<maybe-const<Const, Views>>,
|
| 30 |
+
iterator_t<maybe-const<OtherConst, Views>>> && ...)
|
| 31 |
+
friend constexpr common_type_t<range_difference_t<maybe-const<OtherConst, Views>>...>
|
| 32 |
+
operator-(const sentinel& y, const iterator<OtherConst>& x);
|
| 33 |
+
};
|
| 34 |
+
}
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
``` cpp
|
| 38 |
+
constexpr explicit sentinel(tuple<sentinel_t<maybe-const<Const, Views>>...> end);
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
*Effects:* Initializes *end\_* with `end`.
|
| 42 |
+
|
| 43 |
+
``` cpp
|
| 44 |
+
constexpr sentinel(sentinel<!Const> i)
|
| 45 |
+
requires Const && (convertible_to<sentinel_t<Views>, sentinel_t<const Views>> && ...);
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
*Effects:* Initializes *end\_* with `std::move(i.`*`end_`*`)`.
|
| 49 |
+
|
| 50 |
+
``` cpp
|
| 51 |
+
template<bool OtherConst>
|
| 52 |
+
requires (sentinel_for<sentinel_t<maybe-const<Const, Views>>,
|
| 53 |
+
iterator_t<maybe-const<OtherConst, Views>>> && ...)
|
| 54 |
+
friend constexpr bool operator==(const iterator<OtherConst>& x, const sentinel& y);
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
*Returns:* `true` if there exists an integer 0 ≤ i < `sizeof...(Views)`
|
| 58 |
+
such that
|
| 59 |
+
`bool(std::get<`i`>(x.`*`current_`*`) == std::get<`i`>(y.`*`end_`*`))`
|
| 60 |
+
is `true`. Otherwise, `false`.
|
| 61 |
+
|
| 62 |
+
``` cpp
|
| 63 |
+
template<bool OtherConst>
|
| 64 |
+
requires (sized_sentinel_for<sentinel_t<maybe-const<Const, Views>>,
|
| 65 |
+
iterator_t<maybe-const<OtherConst, Views>>> && ...)
|
| 66 |
+
friend constexpr common_type_t<range_difference_t<maybe-const<OtherConst, Views>>...>
|
| 67 |
+
operator-(const iterator<OtherConst>& x, const sentinel& y);
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
Let `D` be the return type. Let *`DIST`*`(`i`)` be
|
| 71 |
+
`D(std::get<`i`>(x.`*`current_`*`) - std::get<`i`>(y.`*`end_`*`))`.
|
| 72 |
+
|
| 73 |
+
*Returns:* The value with the smallest absolute value among
|
| 74 |
+
*`DIST`*`(`n`)` for all integers 0 ≤ n < `sizeof...(Views)`.
|
| 75 |
+
|
| 76 |
+
``` cpp
|
| 77 |
+
template<bool OtherConst>
|
| 78 |
+
requires (sized_sentinel_for<sentinel_t<maybe-const<Const, Views>>,
|
| 79 |
+
iterator_t<maybe-const<OtherConst, Views>>> && ...)
|
| 80 |
+
friend constexpr common_type_t<range_difference_t<maybe-const<OtherConst, Views>>...>
|
| 81 |
+
operator-(const sentinel& y, const iterator<OtherConst>& x);
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
*Effects:* Equivalent to `return -(x - y);`
|
| 85 |
+
|