- tmp/tmp5p2amt9a/{from.md → to.md} +368 -107
tmp/tmp5p2amt9a/{from.md → to.md}
RENAMED
|
@@ -6,294 +6,555 @@
|
|
| 6 |
#include <iterator> // see [iterator.synopsis]
|
| 7 |
|
| 8 |
namespace std::ranges {
|
| 9 |
inline namespace unspecified {
|
| 10 |
// [range.access], range access
|
| 11 |
-
inline constexpr unspecified begin = unspecified;
|
| 12 |
-
inline constexpr unspecified end = unspecified;
|
| 13 |
-
inline constexpr unspecified cbegin = unspecified;
|
| 14 |
-
inline constexpr unspecified cend = unspecified;
|
| 15 |
-
inline constexpr unspecified rbegin = unspecified;
|
| 16 |
-
inline constexpr unspecified rend = unspecified;
|
| 17 |
-
inline constexpr unspecified crbegin = unspecified;
|
| 18 |
-
inline constexpr unspecified crend = unspecified;
|
| 19 |
|
| 20 |
-
inline constexpr unspecified size = unspecified;
|
| 21 |
-
inline constexpr unspecified ssize = unspecified;
|
| 22 |
-
inline constexpr unspecified empty = unspecified;
|
| 23 |
-
inline constexpr unspecified data = unspecified;
|
| 24 |
-
inline constexpr unspecified cdata = unspecified;
|
| 25 |
}
|
| 26 |
|
| 27 |
// [range.range], ranges
|
| 28 |
template<class T>
|
| 29 |
-
concept range = see below;
|
| 30 |
|
| 31 |
template<class T>
|
| 32 |
-
|
| 33 |
|
| 34 |
template<class T>
|
| 35 |
-
concept borrowed_range = see below;
|
| 36 |
|
| 37 |
template<class T>
|
| 38 |
-
using iterator_t = decltype(ranges::begin(declval<T&>()));
|
| 39 |
template<range R>
|
| 40 |
-
using sentinel_t = decltype(ranges::end(declval<R&>()));
|
| 41 |
template<range R>
|
| 42 |
-
using
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
template<sized_range R>
|
| 44 |
-
using range_size_t = decltype(ranges::size(declval<R&>()));
|
| 45 |
template<range R>
|
| 46 |
-
using range_value_t = iter_value_t<iterator_t<R>>;
|
| 47 |
template<range R>
|
| 48 |
-
using range_reference_t = iter_reference_t<iterator_t<R>>;
|
| 49 |
template<range R>
|
| 50 |
-
using
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
// [range.sized], sized ranges
|
| 53 |
template<class>
|
| 54 |
-
|
| 55 |
|
| 56 |
template<class T>
|
| 57 |
-
concept sized_range = see below;
|
| 58 |
|
| 59 |
// [range.view], views
|
| 60 |
template<class T>
|
| 61 |
-
|
| 62 |
|
| 63 |
-
struct view_base {
|
| 64 |
|
| 65 |
template<class T>
|
| 66 |
-
concept view = see below;
|
| 67 |
|
| 68 |
// [range.refinements], other range refinements
|
| 69 |
template<class R, class T>
|
| 70 |
-
concept output_range = see below;
|
| 71 |
|
| 72 |
template<class T>
|
| 73 |
-
concept input_range = see below;
|
| 74 |
|
| 75 |
template<class T>
|
| 76 |
-
concept forward_range = see below;
|
| 77 |
|
| 78 |
template<class T>
|
| 79 |
-
concept bidirectional_range = see below;
|
| 80 |
|
| 81 |
template<class T>
|
| 82 |
-
concept random_access_range = see below;
|
| 83 |
|
| 84 |
template<class T>
|
| 85 |
-
concept contiguous_range = see below;
|
| 86 |
|
| 87 |
template<class T>
|
| 88 |
-
concept common_range = see below;
|
| 89 |
|
| 90 |
template<class T>
|
| 91 |
-
concept viewable_range = see below;
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
// [view.interface], class template view_interface
|
| 94 |
template<class D>
|
| 95 |
requires is_class_v<D> && same_as<D, remove_cv_t<D>>
|
| 96 |
-
class view_interface;
|
| 97 |
|
| 98 |
// [range.subrange], sub-ranges
|
| 99 |
-
enum class subrange_kind : bool { unsized, sized };
|
| 100 |
|
| 101 |
template<input_or_output_iterator I, sentinel_for<I> S = I, subrange_kind K = see below>
|
| 102 |
requires (K == subrange_kind::sized || !sized_sentinel_for<S, I>)
|
| 103 |
-
class subrange;
|
| 104 |
|
| 105 |
-
template<
|
| 106 |
-
|
| 107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
// [range.dangling], dangling iterator handling
|
| 109 |
-
struct dangling;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
template<range R>
|
| 112 |
-
using borrowed_iterator_t =
|
| 113 |
|
| 114 |
template<range R>
|
| 115 |
-
using borrowed_subrange_t =
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
// [range.empty], empty view
|
| 119 |
template<class T>
|
| 120 |
requires is_object_v<T>
|
| 121 |
-
class empty_view;
|
| 122 |
|
| 123 |
template<class T>
|
| 124 |
-
|
| 125 |
|
| 126 |
namespace views {
|
| 127 |
template<class T>
|
| 128 |
-
|
| 129 |
}
|
| 130 |
|
| 131 |
// [range.single], single view
|
| 132 |
-
template<
|
| 133 |
requires is_object_v<T>
|
| 134 |
-
class single_view;
|
| 135 |
|
| 136 |
-
namespace views { inline constexpr unspecified single = unspecified; }
|
|
|
|
|
|
|
|
|
|
| 137 |
|
| 138 |
// [range.iota], iota view
|
| 139 |
template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t>
|
| 140 |
-
requires weakly-equality-comparable-with<W, Bound>
|
| 141 |
-
class iota_view;
|
| 142 |
|
| 143 |
-
template<
|
| 144 |
-
|
| 145 |
|
| 146 |
-
namespace views { inline constexpr unspecified iota = unspecified; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
|
| 148 |
// [range.istream], istream view
|
| 149 |
template<movable Val, class CharT, class Traits = char_traits<CharT>>
|
| 150 |
requires see below
|
| 151 |
class basic_istream_view;
|
| 152 |
-
template<class Val
|
| 153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
// [range.all], all view
|
| 156 |
namespace views {
|
| 157 |
-
inline constexpr unspecified all = unspecified;
|
| 158 |
|
| 159 |
template<viewable_range R>
|
| 160 |
-
using all_t = decltype(all(declval<R>()));
|
| 161 |
}
|
| 162 |
|
|
|
|
| 163 |
template<range R>
|
| 164 |
requires is_object_v<R>
|
| 165 |
-
class ref_view;
|
| 166 |
|
| 167 |
template<class T>
|
| 168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
|
| 170 |
// [range.filter], filter view
|
| 171 |
template<input_range V, indirect_unary_predicate<iterator_t<V>> Pred>
|
| 172 |
requires view<V> && is_object_v<Pred>
|
| 173 |
-
class filter_view;
|
| 174 |
|
| 175 |
-
namespace views { inline constexpr unspecified filter = unspecified; }
|
| 176 |
|
| 177 |
// [range.transform], transform view
|
| 178 |
-
template<input_range V,
|
| 179 |
requires view<V> && is_object_v<F> &&
|
| 180 |
-
regular_invocable<F&, range_reference_t<V>>
|
| 181 |
-
|
|
|
|
| 182 |
|
| 183 |
-
namespace views { inline constexpr unspecified transform = unspecified; }
|
| 184 |
|
| 185 |
// [range.take], take view
|
| 186 |
-
template<view> class take_view;
|
| 187 |
|
| 188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
|
| 190 |
// [range.take.while], take while view
|
| 191 |
template<view V, class Pred>
|
| 192 |
requires input_range<V> && is_object_v<Pred> &&
|
| 193 |
indirect_unary_predicate<const Pred, iterator_t<V>>
|
| 194 |
-
class take_while_view;
|
| 195 |
|
| 196 |
-
namespace views { inline constexpr unspecified take_while = unspecified; }
|
| 197 |
|
| 198 |
// [range.drop], drop view
|
| 199 |
template<view V>
|
| 200 |
-
class drop_view;
|
| 201 |
|
| 202 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
|
| 204 |
// [range.drop.while], drop while view
|
| 205 |
template<view V, class Pred>
|
| 206 |
requires input_range<V> && is_object_v<Pred> &&
|
| 207 |
indirect_unary_predicate<const Pred, iterator_t<V>>
|
| 208 |
-
class drop_while_view;
|
| 209 |
|
| 210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
|
| 212 |
// [range.join], join view
|
| 213 |
template<input_range V>
|
| 214 |
-
requires view<V> && input_range<range_reference_t<V>>
|
| 215 |
-
|
| 216 |
-
view<range_value_t<V>>)
|
| 217 |
-
class join_view;
|
| 218 |
|
| 219 |
-
namespace views { inline constexpr unspecified join = unspecified; }
|
| 220 |
|
| 221 |
-
// [range.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
template<class R>
|
| 223 |
concept tiny-range = see below; // exposition only
|
| 224 |
|
| 225 |
template<input_range V, forward_range Pattern>
|
| 226 |
requires view<V> && view<Pattern> &&
|
| 227 |
indirectly_comparable<iterator_t<V>, iterator_t<Pattern>, ranges::equal_to> &&
|
| 228 |
(forward_range<V> || tiny-range<Pattern>)
|
| 229 |
-
class
|
| 230 |
|
| 231 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
|
| 233 |
// [range.counted], counted view
|
| 234 |
-
namespace views { inline constexpr unspecified counted = unspecified; }
|
| 235 |
|
| 236 |
// [range.common], common view
|
| 237 |
template<view V>
|
| 238 |
requires (!common_range<V> && copyable<iterator_t<V>>)
|
| 239 |
-
class common_view;
|
| 240 |
|
| 241 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
|
| 243 |
// [range.reverse], reverse view
|
| 244 |
template<view V>
|
| 245 |
requires bidirectional_range<V>
|
| 246 |
-
class reverse_view;
|
| 247 |
|
| 248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
|
| 250 |
// [range.elements], elements view
|
| 251 |
template<input_range V, size_t N>
|
| 252 |
-
requires see below
|
| 253 |
-
class elements_view;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
|
| 255 |
template<class R>
|
| 256 |
-
using keys_view = elements_view<
|
| 257 |
template<class R>
|
| 258 |
-
using values_view = elements_view<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
|
| 260 |
namespace views {
|
| 261 |
template<size_t N>
|
| 262 |
-
|
| 263 |
-
inline constexpr auto
|
| 264 |
-
inline constexpr auto values = elements<1>;
|
| 265 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
}
|
| 267 |
|
| 268 |
namespace std {
|
| 269 |
-
namespace views = ranges::views;
|
|
|
|
|
|
|
|
|
|
| 270 |
|
| 271 |
template<class I, class S, ranges::subrange_kind K>
|
| 272 |
-
struct tuple_size<ranges::subrange<I, S, K>>
|
| 273 |
: integral_constant<size_t, 2> {};
|
| 274 |
template<class I, class S, ranges::subrange_kind K>
|
| 275 |
-
struct tuple_element<0, ranges::subrange<I, S, K>> {
|
| 276 |
-
using type = I;
|
| 277 |
};
|
| 278 |
template<class I, class S, ranges::subrange_kind K>
|
| 279 |
-
struct tuple_element<1, ranges::subrange<I, S, K>> {
|
| 280 |
-
using type = S;
|
| 281 |
};
|
| 282 |
template<class I, class S, ranges::subrange_kind K>
|
| 283 |
-
struct tuple_element<0, const ranges::subrange<I, S, K>> {
|
| 284 |
-
using type = I;
|
| 285 |
};
|
| 286 |
template<class I, class S, ranges::subrange_kind K>
|
| 287 |
-
struct tuple_element<1, const ranges::subrange<I, S, K>> {
|
| 288 |
-
using type = S;
|
| 289 |
};
|
|
|
|
|
|
|
|
|
|
| 290 |
}
|
| 291 |
```
|
| 292 |
|
| 293 |
-
Within this
|
| 294 |
[[iterator.concept.winc]], `make-unsigned-like-t<X>` denotes
|
| 295 |
`make_unsigned_t<X>` if `X` is an integer type; otherwise, it denotes a
|
| 296 |
corresponding unspecified unsigned-integer-like type of the same width
|
| 297 |
as `X`. For an expression `x` of type `X`, `to-unsigned-like(x)` is `x`
|
| 298 |
explicitly converted to `make-unsigned-like-t<X>`.
|
| 299 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
#include <iterator> // see [iterator.synopsis]
|
| 7 |
|
| 8 |
namespace std::ranges {
|
| 9 |
inline namespace unspecified {
|
| 10 |
// [range.access], range access
|
| 11 |
+
inline constexpr unspecified begin = unspecified; // freestanding
|
| 12 |
+
inline constexpr unspecified end = unspecified; // freestanding
|
| 13 |
+
inline constexpr unspecified cbegin = unspecified; // freestanding
|
| 14 |
+
inline constexpr unspecified cend = unspecified; // freestanding
|
| 15 |
+
inline constexpr unspecified rbegin = unspecified; // freestanding
|
| 16 |
+
inline constexpr unspecified rend = unspecified; // freestanding
|
| 17 |
+
inline constexpr unspecified crbegin = unspecified; // freestanding
|
| 18 |
+
inline constexpr unspecified crend = unspecified; // freestanding
|
| 19 |
|
| 20 |
+
inline constexpr unspecified size = unspecified; // freestanding
|
| 21 |
+
inline constexpr unspecified ssize = unspecified; // freestanding
|
| 22 |
+
inline constexpr unspecified empty = unspecified; // freestanding
|
| 23 |
+
inline constexpr unspecified data = unspecified; // freestanding
|
| 24 |
+
inline constexpr unspecified cdata = unspecified; // freestanding
|
| 25 |
}
|
| 26 |
|
| 27 |
// [range.range], ranges
|
| 28 |
template<class T>
|
| 29 |
+
concept range = see below; // freestanding
|
| 30 |
|
| 31 |
template<class T>
|
| 32 |
+
constexpr bool enable_borrowed_range = false; // freestanding
|
| 33 |
|
| 34 |
template<class T>
|
| 35 |
+
concept borrowed_range = see below; // freestanding
|
| 36 |
|
| 37 |
template<class T>
|
| 38 |
+
using iterator_t = decltype(ranges::begin(declval<T&>())); // freestanding
|
| 39 |
template<range R>
|
| 40 |
+
using sentinel_t = decltype(ranges::end(declval<R&>())); // freestanding
|
| 41 |
template<range R>
|
| 42 |
+
using const_iterator_t = const_iterator<iterator_t<R>>; // freestanding
|
| 43 |
+
template<range R>
|
| 44 |
+
using const_sentinel_t = const_sentinel<sentinel_t<R>>; // freestanding
|
| 45 |
+
template<range R>
|
| 46 |
+
using range_difference_t = iter_difference_t<iterator_t<R>>; // freestanding
|
| 47 |
template<sized_range R>
|
| 48 |
+
using range_size_t = decltype(ranges::size(declval<R&>())); // freestanding
|
| 49 |
template<range R>
|
| 50 |
+
using range_value_t = iter_value_t<iterator_t<R>>; // freestanding
|
| 51 |
template<range R>
|
| 52 |
+
using range_reference_t = iter_reference_t<iterator_t<R>>; // freestanding
|
| 53 |
template<range R>
|
| 54 |
+
using range_const_reference_t = iter_const_reference_t<iterator_t<R>>; // freestanding
|
| 55 |
+
template<range R>
|
| 56 |
+
using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>; // freestanding
|
| 57 |
+
template<range R>
|
| 58 |
+
using range_common_reference_t = iter_common_reference_t<iterator_t<R>>; // freestanding
|
| 59 |
|
| 60 |
// [range.sized], sized ranges
|
| 61 |
template<class>
|
| 62 |
+
constexpr bool disable_sized_range = false; // freestanding
|
| 63 |
|
| 64 |
template<class T>
|
| 65 |
+
concept sized_range = see below; // freestanding
|
| 66 |
|
| 67 |
// [range.view], views
|
| 68 |
template<class T>
|
| 69 |
+
constexpr bool enable_view = see below; // freestanding
|
| 70 |
|
| 71 |
+
struct view_base {}; // freestanding
|
| 72 |
|
| 73 |
template<class T>
|
| 74 |
+
concept view = see below; // freestanding
|
| 75 |
|
| 76 |
// [range.refinements], other range refinements
|
| 77 |
template<class R, class T>
|
| 78 |
+
concept output_range = see below; // freestanding
|
| 79 |
|
| 80 |
template<class T>
|
| 81 |
+
concept input_range = see below; // freestanding
|
| 82 |
|
| 83 |
template<class T>
|
| 84 |
+
concept forward_range = see below; // freestanding
|
| 85 |
|
| 86 |
template<class T>
|
| 87 |
+
concept bidirectional_range = see below; // freestanding
|
| 88 |
|
| 89 |
template<class T>
|
| 90 |
+
concept random_access_range = see below; // freestanding
|
| 91 |
|
| 92 |
template<class T>
|
| 93 |
+
concept contiguous_range = see below; // freestanding
|
| 94 |
|
| 95 |
template<class T>
|
| 96 |
+
concept common_range = see below; // freestanding
|
| 97 |
|
| 98 |
template<class T>
|
| 99 |
+
concept viewable_range = see below; // freestanding
|
| 100 |
+
|
| 101 |
+
template<class T>
|
| 102 |
+
concept constant_range = see below; // freestanding
|
| 103 |
|
| 104 |
// [view.interface], class template view_interface
|
| 105 |
template<class D>
|
| 106 |
requires is_class_v<D> && same_as<D, remove_cv_t<D>>
|
| 107 |
+
class view_interface; // freestanding
|
| 108 |
|
| 109 |
// [range.subrange], sub-ranges
|
| 110 |
+
enum class subrange_kind : bool { unsized, sized }; // freestanding
|
| 111 |
|
| 112 |
template<input_or_output_iterator I, sentinel_for<I> S = I, subrange_kind K = see below>
|
| 113 |
requires (K == subrange_kind::sized || !sized_sentinel_for<S, I>)
|
| 114 |
+
class subrange; // freestanding
|
| 115 |
|
| 116 |
+
template<class I, class S, subrange_kind K>
|
| 117 |
+
constexpr bool enable_borrowed_range<subrange<I, S, K>> = true; // freestanding
|
| 118 |
|
| 119 |
+
template<size_t N, class I, class S, subrange_kind K>
|
| 120 |
+
requires ((N == 0 && copyable<I>) || N == 1)
|
| 121 |
+
constexpr auto get(const subrange<I, S, K>& r); // freestanding
|
| 122 |
+
|
| 123 |
+
template<size_t N, class I, class S, subrange_kind K>
|
| 124 |
+
requires (N < 2)
|
| 125 |
+
constexpr auto get(subrange<I, S, K>&& r); // freestanding
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
namespace std {
|
| 129 |
+
using ranges::get; // freestanding
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
namespace std::ranges {
|
| 133 |
// [range.dangling], dangling iterator handling
|
| 134 |
+
struct dangling; // freestanding
|
| 135 |
+
|
| 136 |
+
// [range.elementsof], class template elements_of
|
| 137 |
+
template<range R, class Allocator = allocator<byte>>
|
| 138 |
+
struct elements_of;
|
| 139 |
|
| 140 |
template<range R>
|
| 141 |
+
using borrowed_iterator_t = see below; // freestanding
|
| 142 |
|
| 143 |
template<range R>
|
| 144 |
+
using borrowed_subrange_t = see below; // freestanding
|
| 145 |
+
|
| 146 |
+
// [range.utility.conv], range conversions
|
| 147 |
+
template<class C, input_range R, class... Args> requires (!view<C>)
|
| 148 |
+
constexpr C to(R&& r, Args&&... args); // freestanding
|
| 149 |
+
template<template<class...> class C, input_range R, class... Args>
|
| 150 |
+
constexpr auto to(R&& r, Args&&... args); // freestanding
|
| 151 |
+
template<class C, class... Args> requires (!view<C>)
|
| 152 |
+
constexpr auto to(Args&&... args); // freestanding
|
| 153 |
+
template<template<class...> class C, class... Args>
|
| 154 |
+
constexpr auto to(Args&&... args); // freestanding
|
| 155 |
|
| 156 |
// [range.empty], empty view
|
| 157 |
template<class T>
|
| 158 |
requires is_object_v<T>
|
| 159 |
+
class empty_view; // freestanding
|
| 160 |
|
| 161 |
template<class T>
|
| 162 |
+
constexpr bool enable_borrowed_range<empty_view<T>> = true; // freestanding
|
| 163 |
|
| 164 |
namespace views {
|
| 165 |
template<class T>
|
| 166 |
+
constexpr empty_view<T> empty{}; // freestanding
|
| 167 |
}
|
| 168 |
|
| 169 |
// [range.single], single view
|
| 170 |
+
template<move_constructible T>
|
| 171 |
requires is_object_v<T>
|
| 172 |
+
class single_view; // freestanding
|
| 173 |
|
| 174 |
+
namespace views { inline constexpr unspecified single = unspecified; } // freestanding
|
| 175 |
+
|
| 176 |
+
template<bool Const, class T>
|
| 177 |
+
using maybe-const = conditional_t<Const, const T, T>; // exposition only
|
| 178 |
|
| 179 |
// [range.iota], iota view
|
| 180 |
template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t>
|
| 181 |
+
requires weakly-equality-comparable-with<W, Bound> && copyable<W>
|
| 182 |
+
class iota_view; // freestanding
|
| 183 |
|
| 184 |
+
template<class W, class Bound>
|
| 185 |
+
constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true; // freestanding
|
| 186 |
|
| 187 |
+
namespace views { inline constexpr unspecified iota = unspecified; } // freestanding
|
| 188 |
+
|
| 189 |
+
// [range.repeat], repeat view
|
| 190 |
+
template<move_constructible T, semiregular Bound = unreachable_sentinel_t>
|
| 191 |
+
requires see below
|
| 192 |
+
class repeat_view; // freestanding
|
| 193 |
+
|
| 194 |
+
namespace views { inline constexpr unspecified repeat = unspecified; } // freestanding
|
| 195 |
|
| 196 |
// [range.istream], istream view
|
| 197 |
template<movable Val, class CharT, class Traits = char_traits<CharT>>
|
| 198 |
requires see below
|
| 199 |
class basic_istream_view;
|
| 200 |
+
template<class Val>
|
| 201 |
+
using istream_view = basic_istream_view<Val, char>;
|
| 202 |
+
template<class Val>
|
| 203 |
+
using wistream_view = basic_istream_view<Val, wchar_t>;
|
| 204 |
+
|
| 205 |
+
namespace views { template<class T> constexpr unspecified istream = unspecified; }
|
| 206 |
+
|
| 207 |
+
// [range.adaptor.object], range adaptor objects
|
| 208 |
+
template<class D>
|
| 209 |
+
requires is_class_v<D> && same_as<D, remove_cv_t<D>>
|
| 210 |
+
class range_adaptor_closure { }; // freestanding
|
| 211 |
|
| 212 |
// [range.all], all view
|
| 213 |
namespace views {
|
| 214 |
+
inline constexpr unspecified all = unspecified; // freestanding
|
| 215 |
|
| 216 |
template<viewable_range R>
|
| 217 |
+
using all_t = decltype(all(declval<R>())); // freestanding
|
| 218 |
}
|
| 219 |
|
| 220 |
+
// [range.ref.view], ref view
|
| 221 |
template<range R>
|
| 222 |
requires is_object_v<R>
|
| 223 |
+
class ref_view; // freestanding
|
| 224 |
|
| 225 |
template<class T>
|
| 226 |
+
constexpr bool enable_borrowed_range<ref_view<T>> = true; // freestanding
|
| 227 |
+
|
| 228 |
+
// [range.owning.view], owning view
|
| 229 |
+
template<range R>
|
| 230 |
+
requires see below
|
| 231 |
+
class owning_view; // freestanding
|
| 232 |
+
|
| 233 |
+
template<class T>
|
| 234 |
+
constexpr bool enable_borrowed_range<owning_view<T>> = // freestanding
|
| 235 |
+
enable_borrowed_range<T>;
|
| 236 |
+
|
| 237 |
+
// [range.as.rvalue], as rvalue view
|
| 238 |
+
template<view V>
|
| 239 |
+
requires input_range<V>
|
| 240 |
+
class as_rvalue_view; // freestanding
|
| 241 |
+
|
| 242 |
+
template<class T>
|
| 243 |
+
constexpr bool enable_borrowed_range<as_rvalue_view<T>> = // freestanding
|
| 244 |
+
enable_borrowed_range<T>;
|
| 245 |
+
|
| 246 |
+
namespace views { inline constexpr unspecified as_rvalue = unspecified; } // freestanding
|
| 247 |
|
| 248 |
// [range.filter], filter view
|
| 249 |
template<input_range V, indirect_unary_predicate<iterator_t<V>> Pred>
|
| 250 |
requires view<V> && is_object_v<Pred>
|
| 251 |
+
class filter_view; // freestanding
|
| 252 |
|
| 253 |
+
namespace views { inline constexpr unspecified filter = unspecified; } // freestanding
|
| 254 |
|
| 255 |
// [range.transform], transform view
|
| 256 |
+
template<input_range V, move_constructible F>
|
| 257 |
requires view<V> && is_object_v<F> &&
|
| 258 |
+
regular_invocable<F&, range_reference_t<V>> &&
|
| 259 |
+
can-reference<invoke_result_t<F&, range_reference_t<V>>>
|
| 260 |
+
class transform_view; // freestanding
|
| 261 |
|
| 262 |
+
namespace views { inline constexpr unspecified transform = unspecified; } // freestanding
|
| 263 |
|
| 264 |
// [range.take], take view
|
| 265 |
+
template<view> class take_view; // freestanding
|
| 266 |
|
| 267 |
+
template<class T>
|
| 268 |
+
constexpr bool enable_borrowed_range<take_view<T>> = // freestanding
|
| 269 |
+
enable_borrowed_range<T>;
|
| 270 |
+
|
| 271 |
+
namespace views { inline constexpr unspecified take = unspecified; } // freestanding
|
| 272 |
|
| 273 |
// [range.take.while], take while view
|
| 274 |
template<view V, class Pred>
|
| 275 |
requires input_range<V> && is_object_v<Pred> &&
|
| 276 |
indirect_unary_predicate<const Pred, iterator_t<V>>
|
| 277 |
+
class take_while_view; // freestanding
|
| 278 |
|
| 279 |
+
namespace views { inline constexpr unspecified take_while = unspecified; } // freestanding
|
| 280 |
|
| 281 |
// [range.drop], drop view
|
| 282 |
template<view V>
|
| 283 |
+
class drop_view; // freestanding
|
| 284 |
|
| 285 |
+
template<class T>
|
| 286 |
+
constexpr bool enable_borrowed_range<drop_view<T>> = // freestanding
|
| 287 |
+
enable_borrowed_range<T>;
|
| 288 |
+
|
| 289 |
+
namespace views { inline constexpr unspecified drop = unspecified; } // freestanding
|
| 290 |
|
| 291 |
// [range.drop.while], drop while view
|
| 292 |
template<view V, class Pred>
|
| 293 |
requires input_range<V> && is_object_v<Pred> &&
|
| 294 |
indirect_unary_predicate<const Pred, iterator_t<V>>
|
| 295 |
+
class drop_while_view; // freestanding
|
| 296 |
|
| 297 |
+
template<class T, class Pred>
|
| 298 |
+
constexpr bool enable_borrowed_range<drop_while_view<T, Pred>> = // freestanding
|
| 299 |
+
enable_borrowed_range<T>;
|
| 300 |
+
|
| 301 |
+
namespace views { inline constexpr unspecified drop_while = unspecified; } // freestanding
|
| 302 |
|
| 303 |
// [range.join], join view
|
| 304 |
template<input_range V>
|
| 305 |
+
requires view<V> && input_range<range_reference_t<V>>
|
| 306 |
+
class join_view; // freestanding
|
|
|
|
|
|
|
| 307 |
|
| 308 |
+
namespace views { inline constexpr unspecified join = unspecified; } // freestanding
|
| 309 |
|
| 310 |
+
// [range.join.with], join with view
|
| 311 |
+
template<class R, class P>
|
| 312 |
+
concept compatible-joinable-ranges = see below; // exposition only
|
| 313 |
+
|
| 314 |
+
template<input_range V, forward_range Pattern>
|
| 315 |
+
requires view<V> && input_range<range_reference_t<V>>
|
| 316 |
+
&& view<Pattern>
|
| 317 |
+
&& compatible-joinable-ranges<range_reference_t<V>, Pattern>
|
| 318 |
+
class join_with_view; // freestanding
|
| 319 |
+
|
| 320 |
+
namespace views { inline constexpr unspecified join_with = unspecified; } // freestanding
|
| 321 |
+
|
| 322 |
+
// [range.lazy.split], lazy split view
|
| 323 |
template<class R>
|
| 324 |
concept tiny-range = see below; // exposition only
|
| 325 |
|
| 326 |
template<input_range V, forward_range Pattern>
|
| 327 |
requires view<V> && view<Pattern> &&
|
| 328 |
indirectly_comparable<iterator_t<V>, iterator_t<Pattern>, ranges::equal_to> &&
|
| 329 |
(forward_range<V> || tiny-range<Pattern>)
|
| 330 |
+
class lazy_split_view; // freestanding
|
| 331 |
|
| 332 |
+
// [range.split], split view
|
| 333 |
+
template<forward_range V, forward_range Pattern>
|
| 334 |
+
requires view<V> && view<Pattern> &&
|
| 335 |
+
indirectly_comparable<iterator_t<V>, iterator_t<Pattern>, ranges::equal_to>
|
| 336 |
+
class split_view; // freestanding
|
| 337 |
+
|
| 338 |
+
namespace views {
|
| 339 |
+
inline constexpr unspecified lazy_split = unspecified; // freestanding
|
| 340 |
+
inline constexpr unspecified split = unspecified; // freestanding
|
| 341 |
+
}
|
| 342 |
|
| 343 |
// [range.counted], counted view
|
| 344 |
+
namespace views { inline constexpr unspecified counted = unspecified; } // freestanding
|
| 345 |
|
| 346 |
// [range.common], common view
|
| 347 |
template<view V>
|
| 348 |
requires (!common_range<V> && copyable<iterator_t<V>>)
|
| 349 |
+
class common_view; // freestanding
|
| 350 |
|
| 351 |
+
template<class T>
|
| 352 |
+
constexpr bool enable_borrowed_range<common_view<T>> = // freestanding
|
| 353 |
+
enable_borrowed_range<T>;
|
| 354 |
+
|
| 355 |
+
namespace views { inline constexpr unspecified common = unspecified; } // freestanding
|
| 356 |
|
| 357 |
// [range.reverse], reverse view
|
| 358 |
template<view V>
|
| 359 |
requires bidirectional_range<V>
|
| 360 |
+
class reverse_view; // freestanding
|
| 361 |
|
| 362 |
+
template<class T>
|
| 363 |
+
constexpr bool enable_borrowed_range<reverse_view<T>> = // freestanding
|
| 364 |
+
enable_borrowed_range<T>;
|
| 365 |
+
|
| 366 |
+
namespace views { inline constexpr unspecified reverse = unspecified; } // freestanding
|
| 367 |
+
|
| 368 |
+
// [range.as.const], as const view
|
| 369 |
+
template<input_range R>
|
| 370 |
+
constexpr auto& possibly-const-range(R& r) { // exposition only
|
| 371 |
+
if constexpr (constant_range<const R> && !constant_range<R>) {
|
| 372 |
+
return const_cast<const R&>(r);
|
| 373 |
+
} else {
|
| 374 |
+
return r;
|
| 375 |
+
}
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
template<view V>
|
| 379 |
+
requires input_range<V>
|
| 380 |
+
class as_const_view; // freestanding
|
| 381 |
+
|
| 382 |
+
template<class T>
|
| 383 |
+
constexpr bool enable_borrowed_range<as_const_view<T>> = // freestanding
|
| 384 |
+
enable_borrowed_range<T>;
|
| 385 |
+
|
| 386 |
+
namespace views { inline constexpr unspecified as_const = unspecified; } // freestanding
|
| 387 |
|
| 388 |
// [range.elements], elements view
|
| 389 |
template<input_range V, size_t N>
|
| 390 |
+
requires see below
|
| 391 |
+
class elements_view; // freestanding
|
| 392 |
+
|
| 393 |
+
template<class T, size_t N>
|
| 394 |
+
constexpr bool enable_borrowed_range<elements_view<T, N>> = // freestanding
|
| 395 |
+
enable_borrowed_range<T>;
|
| 396 |
|
| 397 |
template<class R>
|
| 398 |
+
using keys_view = elements_view<R, 0>; // freestanding
|
| 399 |
template<class R>
|
| 400 |
+
using values_view = elements_view<R, 1>; // freestanding
|
| 401 |
+
|
| 402 |
+
namespace views {
|
| 403 |
+
template<size_t N>
|
| 404 |
+
constexpr unspecified elements = unspecified; // freestanding
|
| 405 |
+
inline constexpr auto keys = elements<0>; // freestanding
|
| 406 |
+
inline constexpr auto values = elements<1>; // freestanding
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
// [range.enumerate], enumerate view
|
| 410 |
+
template<input_range View>
|
| 411 |
+
requires view<View>
|
| 412 |
+
class enumerate_view; // freestanding
|
| 413 |
+
|
| 414 |
+
template<class View>
|
| 415 |
+
constexpr bool enable_borrowed_range<enumerate_view<View>> = // freestanding
|
| 416 |
+
enable_borrowed_range<View>;
|
| 417 |
+
|
| 418 |
+
namespace views { inline constexpr unspecified enumerate = unspecified; } // freestanding
|
| 419 |
+
|
| 420 |
+
// [range.zip], zip view
|
| 421 |
+
template<input_range... Views>
|
| 422 |
+
requires (view<Views> && ...) && (sizeof...(Views) > 0)
|
| 423 |
+
class zip_view; // freestanding
|
| 424 |
+
|
| 425 |
+
template<class... Views>
|
| 426 |
+
constexpr bool enable_borrowed_range<zip_view<Views...>> = // freestanding
|
| 427 |
+
(enable_borrowed_range<Views> && ...);
|
| 428 |
+
|
| 429 |
+
namespace views { inline constexpr unspecified zip = unspecified; } // freestanding
|
| 430 |
+
|
| 431 |
+
// [range.zip.transform], zip transform view
|
| 432 |
+
template<move_constructible F, input_range... Views>
|
| 433 |
+
requires (view<Views> && ...) && (sizeof...(Views) > 0) && is_object_v<F> &&
|
| 434 |
+
regular_invocable<F&, range_reference_t<Views>...> &&
|
| 435 |
+
can-reference<invoke_result_t<F&, range_reference_t<Views>...>>
|
| 436 |
+
class zip_transform_view; // freestanding
|
| 437 |
+
|
| 438 |
+
namespace views { inline constexpr unspecified zip_transform = unspecified; } // freestanding
|
| 439 |
+
|
| 440 |
+
// [range.adjacent], adjacent view
|
| 441 |
+
template<forward_range V, size_t N>
|
| 442 |
+
requires view<V> && (N > 0)
|
| 443 |
+
class adjacent_view; // freestanding
|
| 444 |
+
|
| 445 |
+
template<class V, size_t N>
|
| 446 |
+
constexpr bool enable_borrowed_range<adjacent_view<V, N>> = // freestanding
|
| 447 |
+
enable_borrowed_range<V>;
|
| 448 |
+
|
| 449 |
+
namespace views {
|
| 450 |
+
template<size_t N>
|
| 451 |
+
constexpr unspecified adjacent = unspecified; // freestanding
|
| 452 |
+
inline constexpr auto pairwise = adjacent<2>; // freestanding
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
// [range.adjacent.transform], adjacent transform view
|
| 456 |
+
template<forward_range V, move_constructible F, size_t N>
|
| 457 |
+
requires see below
|
| 458 |
+
class adjacent_transform_view; // freestanding
|
| 459 |
|
| 460 |
namespace views {
|
| 461 |
template<size_t N>
|
| 462 |
+
constexpr unspecified adjacent_transform = unspecified; // freestanding
|
| 463 |
+
inline constexpr auto pairwise_transform = adjacent_transform<2>; // freestanding
|
|
|
|
| 464 |
}
|
| 465 |
+
|
| 466 |
+
// [range.chunk], chunk view
|
| 467 |
+
template<view V>
|
| 468 |
+
requires input_range<V>
|
| 469 |
+
class chunk_view; // freestanding
|
| 470 |
+
|
| 471 |
+
template<view V>
|
| 472 |
+
requires forward_range<V>
|
| 473 |
+
class chunk_view<V>; // freestanding
|
| 474 |
+
|
| 475 |
+
template<class V>
|
| 476 |
+
constexpr bool enable_borrowed_range<chunk_view<V>> = // freestanding
|
| 477 |
+
forward_range<V> && enable_borrowed_range<V>;
|
| 478 |
+
|
| 479 |
+
namespace views { inline constexpr unspecified chunk = unspecified; } // freestanding
|
| 480 |
+
|
| 481 |
+
// [range.slide], slide view
|
| 482 |
+
template<forward_range V>
|
| 483 |
+
requires view<V>
|
| 484 |
+
class slide_view; // freestanding
|
| 485 |
+
|
| 486 |
+
template<class V>
|
| 487 |
+
constexpr bool enable_borrowed_range<slide_view<V>> =
|
| 488 |
+
enable_borrowed_range<V>; // freestanding
|
| 489 |
+
|
| 490 |
+
namespace views { inline constexpr unspecified slide = unspecified; } // freestanding
|
| 491 |
+
|
| 492 |
+
// [range.chunk.by], chunk by view
|
| 493 |
+
template<forward_range V, indirect_binary_predicate<iterator_t<V>, iterator_t<V>> Pred>
|
| 494 |
+
requires view<V> && is_object_v<Pred>
|
| 495 |
+
class chunk_by_view; // freestanding
|
| 496 |
+
|
| 497 |
+
namespace views { inline constexpr unspecified chunk_by = unspecified; } // freestanding
|
| 498 |
+
|
| 499 |
+
// [range.stride], stride view
|
| 500 |
+
template<input_range V>
|
| 501 |
+
requires view<V>
|
| 502 |
+
class stride_view; // freestanding
|
| 503 |
+
|
| 504 |
+
template<class V>
|
| 505 |
+
constexpr bool enable_borrowed_range<stride_view<V>> = // freestanding
|
| 506 |
+
enable_borrowed_range<V>;
|
| 507 |
+
|
| 508 |
+
namespace views { inline constexpr unspecified stride = unspecified; } // freestanding
|
| 509 |
+
|
| 510 |
+
// [range.cartesian], cartesian product view
|
| 511 |
+
template<input_range First, forward_range... Vs>
|
| 512 |
+
requires (view<First> && ... && view<Vs>)
|
| 513 |
+
class cartesian_product_view; // freestanding
|
| 514 |
+
|
| 515 |
+
namespace views { inline constexpr unspecified cartesian_product = unspecified; } // freestanding
|
| 516 |
}
|
| 517 |
|
| 518 |
namespace std {
|
| 519 |
+
namespace views = ranges::views; // freestanding
|
| 520 |
+
|
| 521 |
+
template<class T> struct tuple_size; // freestanding
|
| 522 |
+
template<size_t I, class T> struct tuple_element; // freestanding
|
| 523 |
|
| 524 |
template<class I, class S, ranges::subrange_kind K>
|
| 525 |
+
struct tuple_size<ranges::subrange<I, S, K>> // freestanding
|
| 526 |
: integral_constant<size_t, 2> {};
|
| 527 |
template<class I, class S, ranges::subrange_kind K>
|
| 528 |
+
struct tuple_element<0, ranges::subrange<I, S, K>> { // freestanding
|
| 529 |
+
using type = I; // freestanding
|
| 530 |
};
|
| 531 |
template<class I, class S, ranges::subrange_kind K>
|
| 532 |
+
struct tuple_element<1, ranges::subrange<I, S, K>> { // freestanding
|
| 533 |
+
using type = S; // freestanding
|
| 534 |
};
|
| 535 |
template<class I, class S, ranges::subrange_kind K>
|
| 536 |
+
struct tuple_element<0, const ranges::subrange<I, S, K>> { // freestanding
|
| 537 |
+
using type = I; // freestanding
|
| 538 |
};
|
| 539 |
template<class I, class S, ranges::subrange_kind K>
|
| 540 |
+
struct tuple_element<1, const ranges::subrange<I, S, K>> { // freestanding
|
| 541 |
+
using type = S; // freestanding
|
| 542 |
};
|
| 543 |
+
|
| 544 |
+
struct from_range_t { explicit from_range_t() = default; }; // freestanding
|
| 545 |
+
inline constexpr from_range_t from_range{}; // freestanding
|
| 546 |
}
|
| 547 |
```
|
| 548 |
|
| 549 |
+
Within this Clause, for an integer-like type `X`
|
| 550 |
[[iterator.concept.winc]], `make-unsigned-like-t<X>` denotes
|
| 551 |
`make_unsigned_t<X>` if `X` is an integer type; otherwise, it denotes a
|
| 552 |
corresponding unspecified unsigned-integer-like type of the same width
|
| 553 |
as `X`. For an expression `x` of type `X`, `to-unsigned-like(x)` is `x`
|
| 554 |
explicitly converted to `make-unsigned-like-t<X>`.
|
| 555 |
|
| 556 |
+
Also within this Clause, `make-signed-like-t<X>` for an integer-like
|
| 557 |
+
type `X` denotes `make_signed_t<X>` if `X` is an integer type;
|
| 558 |
+
otherwise, it denotes a corresponding unspecified signed-integer-like
|
| 559 |
+
type of the same width as `X`.
|
| 560 |
+
|