| 1 |
/// \file |
| 2 |
// Range v3 library |
| 3 |
// |
| 4 |
// Copyright Eric Niebler 2013-present |
| 5 |
// |
| 6 |
// Use, modification and distribution is subject to the |
| 7 |
// Boost Software License, Version 1.0. (See accompanying |
| 8 |
// file LICENSE_1_0.txt or copy at |
| 9 |
// http://www.boost.org/LICENSE_1_0.txt) |
| 10 |
// |
| 11 |
// Project home: https://github.com/ericniebler/range-v3 |
| 12 |
// |
| 13 |
|
| 14 |
#ifndef RANGES_V3_RANGE_FWD_HPP |
| 15 |
#define RANGES_V3_RANGE_FWD_HPP |
| 16 |
|
| 17 |
#include <type_traits> |
| 18 |
#include <utility> |
| 19 |
|
| 20 |
#include <meta/meta.hpp> |
| 21 |
|
| 22 |
#include <concepts/concepts.hpp> |
| 23 |
#include <concepts/compare.hpp> |
| 24 |
|
| 25 |
#include <range/v3/detail/config.hpp> |
| 26 |
#include <range/v3/utility/static_const.hpp> |
| 27 |
#include <range/v3/version.hpp> |
| 28 |
|
| 29 |
/// \defgroup group-iterator Iterator |
| 30 |
/// Iterator functionality |
| 31 |
|
| 32 |
/// \defgroup group-iterator-concepts Iterator Concepts |
| 33 |
/// \ingroup group-iterator |
| 34 |
/// Iterator concepts |
| 35 |
|
| 36 |
/// \defgroup group-range Range |
| 37 |
/// Core range functionality |
| 38 |
|
| 39 |
/// \defgroup group-range-concepts Range Concepts |
| 40 |
/// \ingroup group-range |
| 41 |
/// Range concepts |
| 42 |
|
| 43 |
/// \defgroup group-algorithms Algorithms |
| 44 |
/// Iterator- and range-based algorithms, like the standard algorithms |
| 45 |
|
| 46 |
/// \defgroup group-views Views |
| 47 |
/// Lazy, non-owning, non-mutating, composable range views |
| 48 |
|
| 49 |
/// \defgroup group-actions Actions |
| 50 |
/// Eager, mutating, composable algorithms |
| 51 |
|
| 52 |
/// \defgroup group-utility Utility |
| 53 |
/// Utility classes |
| 54 |
|
| 55 |
/// \defgroup group-functional Functional |
| 56 |
/// Function and function object utilities |
| 57 |
|
| 58 |
/// \defgroup group-numerics Numerics |
| 59 |
/// Numeric utilities |
| 60 |
|
| 61 |
#include <range/v3/detail/prologue.hpp> |
| 62 |
|
| 63 |
RANGES_DIAGNOSTIC_PUSH |
| 64 |
RANGES_DIAGNOSTIC_IGNORE_CXX17_COMPAT |
| 65 |
|
| 66 |
namespace ranges |
| 67 |
{ |
| 68 |
/// \cond |
| 69 |
namespace views |
| 70 |
{ |
| 71 |
} |
| 72 |
|
| 73 |
namespace actions |
| 74 |
{ |
| 75 |
} |
| 76 |
|
| 77 |
// GCC either fails to accept an attribute on a namespace, or else |
| 78 |
// it ignores the deprecation attribute. Frustrating. |
| 79 |
#if(RANGES_CXX_VER < RANGES_CXX_STD_17 || defined(__GNUC__) && !defined(__clang__)) |
| 80 |
inline namespace v3 |
| 81 |
{ |
| 82 |
using namespace ranges; |
| 83 |
} |
| 84 |
|
| 85 |
namespace view = views; |
| 86 |
namespace action = actions; |
| 87 |
#else |
| 88 |
inline namespace RANGES_DEPRECATED( |
| 89 |
"The name ranges::v3 namespace is deprecated. " |
| 90 |
"Please discontinue using it.") v3 |
| 91 |
{ |
| 92 |
using namespace ranges; |
| 93 |
} |
| 94 |
|
| 95 |
namespace RANGES_DEPRECATED( |
| 96 |
"The ranges::view namespace has been renamed to ranges::views. " |
| 97 |
"(Sorry!)") view |
| 98 |
{ |
| 99 |
using namespace views; |
| 100 |
} |
| 101 |
|
| 102 |
namespace RANGES_DEPRECATED( |
| 103 |
"The ranges::action namespace has been renamed to ranges::actions. " |
| 104 |
"(Sorry!)") action |
| 105 |
{ |
| 106 |
using namespace actions; |
| 107 |
} |
| 108 |
#endif |
| 109 |
|
| 110 |
namespace _end_ |
| 111 |
{ |
| 112 |
struct fn; |
| 113 |
} |
| 114 |
using end_fn = _end_::fn; |
| 115 |
|
| 116 |
namespace _size_ |
| 117 |
{ |
| 118 |
struct fn; |
| 119 |
} |
| 120 |
|
| 121 |
template<typename> |
| 122 |
struct result_of; |
| 123 |
|
| 124 |
template<typename Sig> |
| 125 |
using result_of_t RANGES_DEPRECATED( |
| 126 |
"ranges::result_of_t is deprecated. " |
| 127 |
"Please use ranges::invoke_result_t") = meta::_t<result_of<Sig>>; |
| 128 |
/// \endcond |
| 129 |
|
| 130 |
template<typename...> |
| 131 |
struct variant; |
| 132 |
|
| 133 |
struct dangling; |
| 134 |
|
| 135 |
struct make_pipeable_fn; |
| 136 |
|
| 137 |
struct pipeable_base; |
| 138 |
|
| 139 |
template<typename First, typename Second> |
| 140 |
struct composed; |
| 141 |
|
| 142 |
template<typename... Fns> |
| 143 |
struct overloaded; |
| 144 |
|
| 145 |
namespace actions |
| 146 |
{ |
| 147 |
template<typename ActionFn> |
| 148 |
struct action_closure; |
| 149 |
} |
| 150 |
|
| 151 |
namespace views |
| 152 |
{ |
| 153 |
template<typename ViewFn> |
| 154 |
struct view_closure; |
| 155 |
} |
| 156 |
|
| 157 |
struct advance_fn; |
| 158 |
|
| 159 |
struct advance_to_fn; |
| 160 |
|
| 161 |
struct advance_bounded_fn; |
| 162 |
|
| 163 |
struct next_fn; |
| 164 |
|
| 165 |
struct prev_fn; |
| 166 |
|
| 167 |
struct distance_fn; |
| 168 |
|
| 169 |
struct iter_size_fn; |
| 170 |
|
| 171 |
template<typename T> |
| 172 |
struct indirectly_readable_traits; |
| 173 |
|
| 174 |
template<typename T> |
| 175 |
using readable_traits RANGES_DEPRECATED("Please use ranges::indirectly_readable_traits") |
| 176 |
= indirectly_readable_traits<T>; |
| 177 |
|
| 178 |
template<typename T> |
| 179 |
struct incrementable_traits; |
| 180 |
|
| 181 |
struct view_base |
| 182 |
{}; |
| 183 |
|
| 184 |
/// \cond |
| 185 |
namespace detail |
| 186 |
{ |
| 187 |
template<typename T> |
| 188 |
struct difference_type_; |
| 189 |
|
| 190 |
template<typename T> |
| 191 |
struct value_type_; |
| 192 |
} // namespace detail |
| 193 |
|
| 194 |
template<typename T> |
| 195 |
using difference_type RANGES_DEPRECATED( |
| 196 |
"ranges::difference_type<T>::type is deprecated. Use " |
| 197 |
"ranges::incrementable_traits<T>::difference_type instead.") = |
| 198 |
detail::difference_type_<T>; |
| 199 |
|
| 200 |
template<typename T> |
| 201 |
using value_type RANGES_DEPRECATED( |
| 202 |
"ranges::value_type<T>::type is deprecated. Use " |
| 203 |
"ranges::indirectly_readable_traits<T>::value_type instead.") = detail::value_type_<T>; |
| 204 |
|
| 205 |
template<typename T> |
| 206 |
struct size_type; |
| 207 |
/// \endcond |
| 208 |
|
| 209 |
/// \cond |
| 210 |
namespace detail |
| 211 |
{ |
| 212 |
struct ignore_t |
| 213 |
{ |
| 214 |
ignore_t() = default; |
| 215 |
template<typename T> |
| 216 |
constexpr ignore_t(T &&) noexcept |
| 217 |
{} |
| 218 |
template<typename T> |
| 219 |
constexpr ignore_t const & operator=(T &&) const noexcept |
| 220 |
{ |
| 221 |
return *this; |
| 222 |
} |
| 223 |
}; |
| 224 |
|
| 225 |
struct value_init |
| 226 |
{ |
| 227 |
template<typename T> |
| 228 |
operator T() const |
| 229 |
{ |
| 230 |
return T{}; |
| 231 |
} |
| 232 |
}; |
| 233 |
|
| 234 |
struct make_compressed_pair_fn; |
| 235 |
|
| 236 |
template<typename T> |
| 237 |
constexpr meta::_t<std::remove_reference<T>> && move(T && t) noexcept |
| 238 |
{ |
| 239 |
return static_cast<meta::_t<std::remove_reference<T>> &&>(t); |
| 240 |
} |
| 241 |
|
| 242 |
struct as_const_fn |
| 243 |
{ |
| 244 |
template<typename T> |
| 245 |
constexpr T const & operator()(T & t) const noexcept |
| 246 |
{ |
| 247 |
return t; |
| 248 |
} |
| 249 |
template<typename T> |
| 250 |
constexpr T const && operator()(T && t) const noexcept |
| 251 |
{ |
| 252 |
return (T &&) t; |
| 253 |
} |
| 254 |
}; |
| 255 |
|
| 256 |
RANGES_INLINE_VARIABLE(as_const_fn, as_const) |
| 257 |
|
| 258 |
template<typename T> |
| 259 |
using as_const_t = decltype(as_const(std::declval<T>())); |
| 260 |
|
| 261 |
template<typename T> |
| 262 |
using decay_t = meta::_t<std::decay<T>>; |
| 263 |
|
| 264 |
template<typename T, typename R = meta::_t<std::remove_reference<T>>> |
| 265 |
using as_ref_t = |
| 266 |
meta::_t<std::add_lvalue_reference<meta::_t<std::remove_const<R>>>>; |
| 267 |
|
| 268 |
template<typename T, typename R = meta::_t<std::remove_reference<T>>> |
| 269 |
using as_cref_t = meta::_t<std::add_lvalue_reference<R const>>; |
| 270 |
|
| 271 |
struct get_first; |
| 272 |
struct get_second; |
| 273 |
|
| 274 |
template<typename Val1, typename Val2> |
| 275 |
struct replacer_fn; |
| 276 |
|
| 277 |
template<typename Pred, typename Val> |
| 278 |
struct replacer_if_fn; |
| 279 |
|
| 280 |
template<typename I> |
| 281 |
struct move_into_cursor; |
| 282 |
|
| 283 |
template<typename Int> |
| 284 |
struct from_end_; |
| 285 |
|
| 286 |
template<typename... Ts> |
| 287 |
constexpr int ignore_unused(Ts &&...) |
| 288 |
{ |
| 289 |
return 42; |
| 290 |
} |
| 291 |
|
| 292 |
template<int I> |
| 293 |
struct priority_tag : priority_tag<I - 1> |
| 294 |
{}; |
| 295 |
|
| 296 |
template<> |
| 297 |
struct priority_tag<0> |
| 298 |
{}; |
| 299 |
|
| 300 |
#if defined(__clang__) && !defined(_LIBCPP_VERSION) |
| 301 |
template<typename T, typename... Args> |
| 302 |
RANGES_INLINE_VAR constexpr bool is_trivially_constructible_v = |
| 303 |
__is_trivially_constructible(T, Args...); |
| 304 |
template<typename T> |
| 305 |
RANGES_INLINE_VAR constexpr bool is_trivially_default_constructible_v = |
| 306 |
is_trivially_constructible_v<T>; |
| 307 |
template<typename T> |
| 308 |
RANGES_INLINE_VAR constexpr bool is_trivially_copy_constructible_v = |
| 309 |
is_trivially_constructible_v<T, T const &>; |
| 310 |
template<typename T> |
| 311 |
RANGES_INLINE_VAR constexpr bool is_trivially_move_constructible_v = |
| 312 |
is_trivially_constructible_v<T, T>; |
| 313 |
template<typename T> |
| 314 |
RANGES_INLINE_VAR constexpr bool is_trivially_copyable_v = |
| 315 |
__is_trivially_copyable(T); |
| 316 |
template<typename T, typename U> |
| 317 |
RANGES_INLINE_VAR constexpr bool is_trivially_assignable_v = |
| 318 |
__is_trivially_assignable(T, U); |
| 319 |
template<typename T> |
| 320 |
RANGES_INLINE_VAR constexpr bool is_trivially_copy_assignable_v = |
| 321 |
is_trivially_assignable_v<T &, T const &>; |
| 322 |
template<typename T> |
| 323 |
RANGES_INLINE_VAR constexpr bool is_trivially_move_assignable_v = |
| 324 |
is_trivially_assignable_v<T &, T>; |
| 325 |
|
| 326 |
template<typename T, typename... Args> |
| 327 |
struct is_trivially_constructible |
| 328 |
: meta::bool_<is_trivially_constructible_v<T, Args...>> |
| 329 |
{}; |
| 330 |
template<typename T> |
| 331 |
struct is_trivially_default_constructible |
| 332 |
: meta::bool_<is_trivially_default_constructible_v<T>> |
| 333 |
{}; |
| 334 |
template<typename T> |
| 335 |
struct is_trivially_copy_constructible |
| 336 |
: meta::bool_<is_trivially_copy_constructible_v<T>> |
| 337 |
{}; |
| 338 |
template<typename T> |
| 339 |
struct is_trivially_move_constructible |
| 340 |
: meta::bool_<is_trivially_move_constructible_v<T>> |
| 341 |
{}; |
| 342 |
template<typename T> |
| 343 |
struct is_trivially_copyable |
| 344 |
: meta::bool_<is_trivially_copyable_v<T>> |
| 345 |
{}; |
| 346 |
template<typename T, typename U> |
| 347 |
struct is_trivially_assignable |
| 348 |
: meta::bool_<is_trivially_assignable_v<T, U>> |
| 349 |
{}; |
| 350 |
template<typename T> |
| 351 |
struct is_trivially_copy_assignable |
| 352 |
: meta::bool_<is_trivially_copy_assignable_v<T>> |
| 353 |
{}; |
| 354 |
template<typename T> |
| 355 |
struct is_trivially_move_assignable |
| 356 |
: meta::bool_<is_trivially_move_assignable_v<T>> |
| 357 |
{}; |
| 358 |
#else |
| 359 |
using std::is_trivially_constructible; |
| 360 |
using std::is_trivially_default_constructible; |
| 361 |
using std::is_trivially_copy_assignable; |
| 362 |
using std::is_trivially_copy_constructible; |
| 363 |
using std::is_trivially_copyable; |
| 364 |
using std::is_trivially_assignable; |
| 365 |
using std::is_trivially_move_assignable; |
| 366 |
using std::is_trivially_move_constructible; |
| 367 |
#if META_CXX_TRAIT_VARIABLE_TEMPLATES |
| 368 |
using std::is_trivially_constructible_v; |
| 369 |
using std::is_trivially_default_constructible_v; |
| 370 |
using std::is_trivially_copy_assignable_v; |
| 371 |
using std::is_trivially_copy_constructible_v; |
| 372 |
using std::is_trivially_copyable_v; |
| 373 |
using std::is_trivially_assignable_v; |
| 374 |
using std::is_trivially_move_assignable_v; |
| 375 |
using std::is_trivially_move_constructible_v; |
| 376 |
#else |
| 377 |
template<typename T, typename... Args> |
| 378 |
RANGES_INLINE_VAR constexpr bool is_trivially_constructible_v = |
| 379 |
is_trivially_constructible<T, Args...>::value; |
| 380 |
template<typename T> |
| 381 |
RANGES_INLINE_VAR constexpr bool is_trivially_default_constructible_v = |
| 382 |
is_trivially_default_constructible<T>::value; |
| 383 |
template<typename T> |
| 384 |
RANGES_INLINE_VAR constexpr bool is_trivially_copy_constructible_v = |
| 385 |
is_trivially_copy_constructible<T>::value; |
| 386 |
template<typename T> |
| 387 |
RANGES_INLINE_VAR constexpr bool is_trivially_move_constructible_v = |
| 388 |
is_trivially_move_constructible<T>::value; |
| 389 |
template<typename T> |
| 390 |
RANGES_INLINE_VAR constexpr bool is_trivially_copyable_v = |
| 391 |
is_trivially_copyable<T>::value; |
| 392 |
template<typename T, typename U> |
| 393 |
RANGES_INLINE_VAR constexpr bool is_trivially_assignable_v = |
| 394 |
is_trivially_assignable<T, U>::value; |
| 395 |
template<typename T> |
| 396 |
RANGES_INLINE_VAR constexpr bool is_trivially_copy_assignable_v = |
| 397 |
is_trivially_copy_assignable<T>::value; |
| 398 |
template<typename T> |
| 399 |
RANGES_INLINE_VAR constexpr bool is_trivially_move_assignable_v = |
| 400 |
is_trivially_move_assignable<T>::value; |
| 401 |
#endif |
| 402 |
#endif |
| 403 |
|
| 404 |
template<typename T> |
| 405 |
RANGES_INLINE_VAR constexpr bool is_trivial_v = |
| 406 |
is_trivially_copyable_v<T> && |
| 407 |
is_trivially_default_constructible_v<T>; |
| 408 |
|
| 409 |
template<typename T> |
| 410 |
struct is_trivial |
| 411 |
: meta::bool_<is_trivial_v<T>> |
| 412 |
{}; |
| 413 |
|
| 414 |
#if RANGES_CXX_LIB_IS_FINAL > 0 |
| 415 |
#if defined(__clang__) && !defined(_LIBCPP_VERSION) |
| 416 |
template<typename T> |
| 417 |
RANGES_INLINE_VAR constexpr bool is_final_v = __is_final(T); |
| 418 |
|
| 419 |
template<typename T> |
| 420 |
struct is_final |
| 421 |
: meta::bool_<is_final_v<T>> |
| 422 |
{}; |
| 423 |
#else |
| 424 |
using std::is_final; |
| 425 |
#if META_CXX_TRAIT_VARIABLE_TEMPLATES |
| 426 |
using std::is_final_v; |
| 427 |
#else |
| 428 |
template<typename T> |
| 429 |
RANGES_INLINE_VAR constexpr bool is_final_v = is_final<T>::value; |
| 430 |
#endif |
| 431 |
#endif |
| 432 |
#else |
| 433 |
template<typename T> |
| 434 |
RANGES_INLINE_VAR constexpr bool is_final_v = false; |
| 435 |
|
| 436 |
template<typename T> |
| 437 |
using is_final = std::false_type; |
| 438 |
#endif |
| 439 |
|
| 440 |
// Work around libc++'s buggy std::is_function |
| 441 |
// Function types here: |
| 442 |
template<typename T> |
| 443 |
char (&is_function_impl_(priority_tag<0>))[1]; |
| 444 |
|
| 445 |
// Array types here: |
| 446 |
template<typename T, typename = decltype((*(T *)0)[0])> |
| 447 |
char (&is_function_impl_(priority_tag<1>))[2]; |
| 448 |
|
| 449 |
// Anything that can be returned from a function here (including |
| 450 |
// void and reference types): |
| 451 |
template<typename T, typename = T (*)()> |
| 452 |
char (&is_function_impl_(priority_tag<2>))[3]; |
| 453 |
|
| 454 |
// Classes and unions (including abstract types) here: |
| 455 |
template<typename T, typename = int T::*> |
| 456 |
char (&is_function_impl_(priority_tag<3>))[4]; |
| 457 |
|
| 458 |
template<typename T> |
| 459 |
RANGES_INLINE_VAR constexpr bool is_function_v = |
| 460 |
sizeof(detail::is_function_impl_<T>(priority_tag<3>{})) == 1; |
| 461 |
|
| 462 |
template<typename T> |
| 463 |
struct remove_rvalue_reference |
| 464 |
{ |
| 465 |
using type = T; |
| 466 |
}; |
| 467 |
|
| 468 |
template<typename T> |
| 469 |
struct remove_rvalue_reference<T &&> |
| 470 |
{ |
| 471 |
using type = T; |
| 472 |
}; |
| 473 |
|
| 474 |
template<typename T> |
| 475 |
using remove_rvalue_reference_t = meta::_t<remove_rvalue_reference<T>>; |
| 476 |
|
| 477 |
// Workaround bug in the Standard Library: |
| 478 |
// From cannot be an incomplete class type despite that |
| 479 |
// is_convertible<X, Y> should be equivalent to is_convertible<X&&, Y> |
| 480 |
// in such a case. |
| 481 |
template<typename From, typename To> |
| 482 |
using is_convertible = |
| 483 |
std::is_convertible<meta::_t<std::add_rvalue_reference<From>>, To>; |
| 484 |
} // namespace detail |
| 485 |
/// \endcond |
| 486 |
|
| 487 |
struct begin_tag |
| 488 |
{}; |
| 489 |
struct end_tag |
| 490 |
{}; |
| 491 |
struct copy_tag |
| 492 |
{}; |
| 493 |
struct move_tag |
| 494 |
{}; |
| 495 |
|
| 496 |
template<typename T> |
| 497 |
using uncvref_t = meta::_t<std::remove_cv<meta::_t<std::remove_reference<T>>>>; |
| 498 |
|
| 499 |
struct not_equal_to; |
| 500 |
struct equal_to; |
| 501 |
struct less; |
| 502 |
#if __cplusplus > 201703L && __has_include(<compare>) && \ |
| 503 |
defined(__cpp_concepts) && defined(__cpp_impl_three_way_comparison) |
| 504 |
struct compare_three_way; |
| 505 |
#endif // __cplusplus |
| 506 |
struct identity; |
| 507 |
template<typename Pred> |
| 508 |
struct logical_negate; |
| 509 |
|
| 510 |
enum cardinality : std::ptrdiff_t |
| 511 |
{ |
| 512 |
infinite = -3, |
| 513 |
unknown = -2, |
| 514 |
finite = -1 |
| 515 |
}; |
| 516 |
|
| 517 |
template<typename Rng, typename Void = void> |
| 518 |
struct range_cardinality; |
| 519 |
|
| 520 |
template<typename Rng> |
| 521 |
using is_finite = meta::bool_<range_cardinality<Rng>::value >= finite>; |
| 522 |
|
| 523 |
template<typename Rng> |
| 524 |
using is_infinite = meta::bool_<range_cardinality<Rng>::value == infinite>; |
| 525 |
|
| 526 |
template<typename S, typename I> |
| 527 |
RANGES_INLINE_VAR constexpr bool disable_sized_sentinel = false; |
| 528 |
|
| 529 |
template<typename R> |
| 530 |
RANGES_INLINE_VAR constexpr bool enable_borrowed_range = false; |
| 531 |
|
| 532 |
namespace detail |
| 533 |
{ |
| 534 |
template<typename R> |
| 535 |
RANGES_DEPRECATED("Please use ranges::enable_borrowed_range instead.") |
| 536 |
RANGES_INLINE_VAR constexpr bool enable_safe_range = enable_borrowed_range<R>; |
| 537 |
} // namespace detail |
| 538 |
|
| 539 |
using detail::enable_safe_range; |
| 540 |
|
| 541 |
template<typename Cur> |
| 542 |
struct basic_mixin; |
| 543 |
|
| 544 |
template<typename Cur> |
| 545 |
struct RANGES_EMPTY_BASES basic_iterator; |
| 546 |
|
| 547 |
template<cardinality> |
| 548 |
struct basic_view : view_base |
| 549 |
{}; |
| 550 |
|
| 551 |
template<typename Derived, cardinality C = finite> |
| 552 |
struct view_facade; |
| 553 |
|
| 554 |
template<typename Derived, typename BaseRng, |
| 555 |
cardinality C = range_cardinality<BaseRng>::value> |
| 556 |
struct view_adaptor; |
| 557 |
|
| 558 |
template<typename I, typename S> |
| 559 |
struct common_iterator; |
| 560 |
|
| 561 |
/// \cond |
| 562 |
namespace detail |
| 563 |
{ |
| 564 |
template<typename I> |
| 565 |
struct cpp17_iterator_cursor; |
| 566 |
|
| 567 |
template<typename I> |
| 568 |
using cpp17_iterator = basic_iterator<cpp17_iterator_cursor<I>>; |
| 569 |
} // namespace detail |
| 570 |
/// \endcond |
| 571 |
|
| 572 |
template<typename First, typename Second> |
| 573 |
struct compressed_pair; |
| 574 |
|
| 575 |
template<typename T> |
| 576 |
struct bind_element; |
| 577 |
|
| 578 |
template<typename T> |
| 579 |
using bind_element_t = meta::_t<bind_element<T>>; |
| 580 |
|
| 581 |
template<typename Derived, cardinality = finite> |
| 582 |
struct view_interface; |
| 583 |
|
| 584 |
template<typename T> |
| 585 |
struct istream_view; |
| 586 |
|
| 587 |
template<typename I, typename S = I> |
| 588 |
struct RANGES_EMPTY_BASES iterator_range; |
| 589 |
|
| 590 |
template<typename I, typename S = I> |
| 591 |
struct sized_iterator_range; |
| 592 |
|
| 593 |
template<typename T> |
| 594 |
struct reference_wrapper; |
| 595 |
|
| 596 |
// Views |
| 597 |
// |
| 598 |
template<typename Rng, typename Pred> |
| 599 |
struct RANGES_EMPTY_BASES adjacent_filter_view; |
| 600 |
|
| 601 |
namespace views |
| 602 |
{ |
| 603 |
struct adjacent_filter_fn; |
| 604 |
} |
| 605 |
|
| 606 |
template<typename Rng, typename Pred> |
| 607 |
struct RANGES_EMPTY_BASES adjacent_remove_if_view; |
| 608 |
|
| 609 |
namespace views |
| 610 |
{ |
| 611 |
struct adjacent_remove_if_fn; |
| 612 |
} |
| 613 |
|
| 614 |
namespace views |
| 615 |
{ |
| 616 |
struct all_fn; |
| 617 |
} |
| 618 |
|
| 619 |
|
| 620 |
template<typename Rng, typename Fun> |
| 621 |
struct chunk_by_view; |
| 622 |
|
| 623 |
namespace views |
| 624 |
{ |
| 625 |
struct chunk_by_fn; |
| 626 |
} |
| 627 |
|
| 628 |
template<typename Rng> |
| 629 |
struct const_view; |
| 630 |
|
| 631 |
namespace views |
| 632 |
{ |
| 633 |
struct const_fn; |
| 634 |
} |
| 635 |
|
| 636 |
template<typename I> |
| 637 |
struct counted_view; |
| 638 |
|
| 639 |
namespace views |
| 640 |
{ |
| 641 |
struct counted_fn; |
| 642 |
} |
| 643 |
|
| 644 |
struct default_sentinel_t; |
| 645 |
|
| 646 |
template<typename I> |
| 647 |
struct move_iterator; |
| 648 |
|
| 649 |
template<typename I> |
| 650 |
using move_into_iterator = basic_iterator<detail::move_into_cursor<I>>; |
| 651 |
|
| 652 |
template<typename Rng, bool = (bool)is_infinite<Rng>()> |
| 653 |
struct RANGES_EMPTY_BASES cycled_view; |
| 654 |
|
| 655 |
namespace views |
| 656 |
{ |
| 657 |
struct cycle_fn; |
| 658 |
} |
| 659 |
|
| 660 |
/// \cond |
| 661 |
namespace detail |
| 662 |
{ |
| 663 |
template<typename I> |
| 664 |
struct reverse_cursor; |
| 665 |
} |
| 666 |
/// \endcond |
| 667 |
|
| 668 |
template<typename I> |
| 669 |
using reverse_iterator = basic_iterator<detail::reverse_cursor<I>>; |
| 670 |
|
| 671 |
template<typename T> |
| 672 |
struct empty_view; |
| 673 |
|
| 674 |
namespace views |
| 675 |
{ |
| 676 |
struct empty_fn; |
| 677 |
} |
| 678 |
|
| 679 |
template<typename Rng, typename Fun> |
| 680 |
struct group_by_view; |
| 681 |
|
| 682 |
namespace views |
| 683 |
{ |
| 684 |
struct group_by_fn; |
| 685 |
} |
| 686 |
|
| 687 |
template<typename Rng> |
| 688 |
struct indirect_view; |
| 689 |
|
| 690 |
namespace views |
| 691 |
{ |
| 692 |
struct indirect_fn; |
| 693 |
} |
| 694 |
|
| 695 |
struct unreachable_sentinel_t; |
| 696 |
|
| 697 |
template<typename From, typename To = unreachable_sentinel_t> |
| 698 |
struct iota_view; |
| 699 |
|
| 700 |
template<typename From, typename To = From> |
| 701 |
struct closed_iota_view; |
| 702 |
|
| 703 |
namespace views |
| 704 |
{ |
| 705 |
struct iota_fn; |
| 706 |
struct closed_iota_fn; |
| 707 |
} // namespace views |
| 708 |
|
| 709 |
template<typename Rng> |
| 710 |
struct join_view; |
| 711 |
|
| 712 |
template<typename Rng, typename ValRng> |
| 713 |
struct join_with_view; |
| 714 |
|
| 715 |
namespace views |
| 716 |
{ |
| 717 |
struct join_fn; |
| 718 |
} |
| 719 |
|
| 720 |
template<typename... Rngs> |
| 721 |
struct concat_view; |
| 722 |
|
| 723 |
namespace views |
| 724 |
{ |
| 725 |
struct concat_fn; |
| 726 |
} |
| 727 |
|
| 728 |
template<typename Rng, typename Fun> |
| 729 |
struct partial_sum_view; |
| 730 |
|
| 731 |
namespace views |
| 732 |
{ |
| 733 |
struct partial_sum_fn; |
| 734 |
} |
| 735 |
|
| 736 |
template<typename Rng> |
| 737 |
struct move_view; |
| 738 |
|
| 739 |
namespace views |
| 740 |
{ |
| 741 |
struct move_fn; |
| 742 |
} |
| 743 |
|
| 744 |
template<typename Rng> |
| 745 |
struct ref_view; |
| 746 |
|
| 747 |
namespace views |
| 748 |
{ |
| 749 |
struct ref_fn; |
| 750 |
} |
| 751 |
|
| 752 |
template<typename Val> |
| 753 |
struct repeat_view; |
| 754 |
|
| 755 |
namespace views |
| 756 |
{ |
| 757 |
struct repeat_fn; |
| 758 |
} |
| 759 |
|
| 760 |
template<typename Rng> |
| 761 |
struct RANGES_EMPTY_BASES reverse_view; |
| 762 |
|
| 763 |
namespace views |
| 764 |
{ |
| 765 |
struct reverse_fn; |
| 766 |
} |
| 767 |
|
| 768 |
template<typename Rng> |
| 769 |
struct slice_view; |
| 770 |
|
| 771 |
namespace views |
| 772 |
{ |
| 773 |
struct slice_fn; |
| 774 |
} |
| 775 |
|
| 776 |
// template<typename Rng, typename Fun> |
| 777 |
// struct split_view; |
| 778 |
|
| 779 |
// namespace views |
| 780 |
// { |
| 781 |
// struct split_fn; |
| 782 |
// } |
| 783 |
|
| 784 |
template<typename Rng> |
| 785 |
struct single_view; |
| 786 |
|
| 787 |
namespace views |
| 788 |
{ |
| 789 |
struct single_fn; |
| 790 |
} |
| 791 |
|
| 792 |
template<typename Rng> |
| 793 |
struct stride_view; |
| 794 |
|
| 795 |
namespace views |
| 796 |
{ |
| 797 |
struct stride_fn; |
| 798 |
} |
| 799 |
|
| 800 |
template<typename Rng> |
| 801 |
struct take_view; |
| 802 |
|
| 803 |
namespace views |
| 804 |
{ |
| 805 |
struct take_fn; |
| 806 |
} |
| 807 |
|
| 808 |
/// \cond |
| 809 |
namespace detail |
| 810 |
{ |
| 811 |
template<typename Rng> |
| 812 |
struct is_random_access_common_; |
| 813 |
|
| 814 |
template<typename Rng, |
| 815 |
bool IsRandomAccessCommon = is_random_access_common_<Rng>::value> |
| 816 |
struct take_exactly_view_; |
| 817 |
} // namespace detail |
| 818 |
/// \endcond |
| 819 |
|
| 820 |
template<typename Rng> |
| 821 |
using take_exactly_view = detail::take_exactly_view_<Rng>; |
| 822 |
|
| 823 |
namespace views |
| 824 |
{ |
| 825 |
struct take_exactly_fn; |
| 826 |
} |
| 827 |
|
| 828 |
template<typename Rng, typename Pred> |
| 829 |
struct iter_take_while_view; |
| 830 |
|
| 831 |
template<typename Rng, typename Pred> |
| 832 |
struct take_while_view; |
| 833 |
|
| 834 |
namespace views |
| 835 |
{ |
| 836 |
struct iter_take_while_fn; |
| 837 |
struct take_while_fn; |
| 838 |
} // namespace views |
| 839 |
|
| 840 |
template<typename Rng, typename Regex, typename SubMatchRange> |
| 841 |
struct tokenize_view; |
| 842 |
|
| 843 |
namespace views |
| 844 |
{ |
| 845 |
struct tokenize_fn; |
| 846 |
} |
| 847 |
|
| 848 |
template<typename Rng, typename Fun> |
| 849 |
struct iter_transform_view; |
| 850 |
|
| 851 |
template<typename Rng, typename Fun> |
| 852 |
struct transform_view; |
| 853 |
|
| 854 |
namespace views |
| 855 |
{ |
| 856 |
struct transform_fn; |
| 857 |
} |
| 858 |
|
| 859 |
template<typename Rng, typename Val1, typename Val2> |
| 860 |
using replace_view = iter_transform_view<Rng, detail::replacer_fn<Val1, Val2>>; |
| 861 |
|
| 862 |
template<typename Rng, typename Pred, typename Val> |
| 863 |
using replace_if_view = iter_transform_view<Rng, detail::replacer_if_fn<Pred, Val>>; |
| 864 |
|
| 865 |
namespace views |
| 866 |
{ |
| 867 |
struct replace_fn; |
| 868 |
|
| 869 |
struct replace_if_fn; |
| 870 |
} // namespace views |
| 871 |
|
| 872 |
template<typename Rng, typename Pred> |
| 873 |
struct trim_view; |
| 874 |
|
| 875 |
namespace views |
| 876 |
{ |
| 877 |
struct trim_fn; |
| 878 |
} |
| 879 |
|
| 880 |
template<typename I> |
| 881 |
struct unbounded_view; |
| 882 |
|
| 883 |
namespace views |
| 884 |
{ |
| 885 |
struct unbounded_fn; |
| 886 |
} |
| 887 |
|
| 888 |
template<typename Rng> |
| 889 |
using unique_view = adjacent_filter_view<Rng, logical_negate<equal_to>>; |
| 890 |
|
| 891 |
namespace views |
| 892 |
{ |
| 893 |
struct unique_fn; |
| 894 |
} |
| 895 |
|
| 896 |
template<typename Rng> |
| 897 |
using keys_range_view = transform_view<Rng, detail::get_first>; |
| 898 |
|
| 899 |
template<typename Rng> |
| 900 |
using values_view = transform_view<Rng, detail::get_second>; |
| 901 |
|
| 902 |
namespace views |
| 903 |
{ |
| 904 |
struct keys_fn; |
| 905 |
|
| 906 |
struct values_fn; |
| 907 |
} // namespace views |
| 908 |
|
| 909 |
template<typename Fun, typename... Rngs> |
| 910 |
struct iter_zip_with_view; |
| 911 |
|
| 912 |
template<typename Fun, typename... Rngs> |
| 913 |
struct zip_with_view; |
| 914 |
|
| 915 |
template<typename... Rngs> |
| 916 |
struct zip_view; |
| 917 |
|
| 918 |
namespace views |
| 919 |
{ |
| 920 |
struct iter_zip_with_fn; |
| 921 |
|
| 922 |
struct zip_with_fn; |
| 923 |
|
| 924 |
struct zip_fn; |
| 925 |
} // namespace views |
| 926 |
} // namespace ranges |
| 927 |
|
| 928 |
/// \cond |
| 929 |
namespace ranges |
| 930 |
{ |
| 931 |
namespace concepts = ::concepts; |
| 932 |
using namespace ::concepts::defs; |
| 933 |
using ::concepts::and_v; |
| 934 |
} // namespace ranges |
| 935 |
/// \endcond |
| 936 |
|
| 937 |
RANGES_DIAGNOSTIC_POP |
| 938 |
|
| 939 |
#include <range/v3/detail/epilogue.hpp> |
| 940 |
|
| 941 |
#endif |