14#ifndef RANGES_V3_RANGE_FWD_HPP
15#define RANGES_V3_RANGE_FWD_HPP
25#include <range/v3/detail/config.hpp>
26#include <range/v3/utility/static_const.hpp>
61#include <range/v3/detail/prologue.hpp>
64RANGES_DIAGNOSTIC_IGNORE_CXX17_COMPAT
79#if(RANGES_CXX_VER < RANGES_CXX_STD_17 || defined(__GNUC__) && !defined(__clang__))
82 using namespace ranges;
85 namespace view = views;
86 namespace action = actions;
88 inline namespace RANGES_DEPRECATED(
89 "The name ranges::v3 namespace is deprecated. "
90 "Please discontinue using it.") v3
92 using namespace ranges;
95 namespace RANGES_DEPRECATED(
96 "The ranges::view namespace has been renamed to ranges::views. "
99 using namespace views;
102 namespace RANGES_DEPRECATED(
103 "The ranges::action namespace has been renamed to ranges::actions. "
106 using namespace actions;
114 using end_fn = _end_::fn;
124 template<
typename Sig>
125 using result_of_t RANGES_DEPRECATED(
126 "ranges::result_of_t is deprecated. "
130 template<
typename...>
139 template<
typename First,
typename Second>
142 template<
typename... Fns>
147 template<
typename ActionFn>
148 struct action_closure;
153 template<
typename ViewFn>
159 struct advance_to_fn;
161 struct advance_bounded_fn;
175 using readable_traits RANGES_DEPRECATED(
"Please use ranges::indirectly_readable_traits")
188 struct difference_type_;
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>;
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>;
214 ignore_t() =
default;
216 constexpr ignore_t(T &&) noexcept
219 constexpr ignore_t
const & operator=(T &&) const noexcept
245 constexpr T
const & operator()(T & t)
const noexcept
250 constexpr T
const && operator()(T && t)
const noexcept
256 RANGES_INLINE_VARIABLE(as_const_fn, as_const)
259 using as_const_t =
decltype(as_const(std::declval<T>()));
264 template<
typename T,
typename R = meta::_t<std::remove_reference<T>>>
268 template<
typename T,
typename R = meta::_t<std::remove_reference<T>>>
274 template<
typename Val1,
typename Val2>
277 template<
typename Pred,
typename Val>
278 struct replacer_if_fn;
281 struct move_into_cursor;
283 template<
typename Int>
286 template<
typename... Ts>
287 constexpr int ignore_unused(Ts &&...)
293 struct priority_tag : priority_tag<I - 1>
297 struct priority_tag<0>
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...);
305 RANGES_INLINE_VAR
constexpr bool is_trivially_default_constructible_v =
306 is_trivially_constructible_v<T>;
308 RANGES_INLINE_VAR
constexpr bool is_trivially_copy_constructible_v =
309 is_trivially_constructible_v<T, T const &>;
311 RANGES_INLINE_VAR
constexpr bool is_trivially_move_constructible_v =
312 is_trivially_constructible_v<T, 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);
320 RANGES_INLINE_VAR
constexpr bool is_trivially_copy_assignable_v =
321 is_trivially_assignable_v<T &, T const &>;
323 RANGES_INLINE_VAR
constexpr bool is_trivially_move_assignable_v =
324 is_trivially_assignable_v<T &, T>;
326 template<
typename T,
typename... Args>
327 struct is_trivially_constructible
328 :
meta::bool_<is_trivially_constructible_v<T, Args...>>
331 struct is_trivially_default_constructible
332 :
meta::bool_<is_trivially_default_constructible_v<T>>
335 struct is_trivially_copy_constructible
336 :
meta::bool_<is_trivially_copy_constructible_v<T>>
339 struct is_trivially_move_constructible
340 :
meta::bool_<is_trivially_move_constructible_v<T>>
343 struct is_trivially_copyable
346 template<
typename T,
typename U>
347 struct is_trivially_assignable
351 struct is_trivially_copy_assignable
355 struct is_trivially_move_assignable
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;
377 template<
typename T,
typename... Args>
378 RANGES_INLINE_VAR
constexpr bool is_trivially_constructible_v =
379 is_trivially_constructible<T, Args...>::value;
381 RANGES_INLINE_VAR
constexpr bool is_trivially_default_constructible_v =
382 is_trivially_default_constructible<T>::value;
384 RANGES_INLINE_VAR
constexpr bool is_trivially_copy_constructible_v =
385 is_trivially_copy_constructible<T>::value;
387 RANGES_INLINE_VAR
constexpr bool is_trivially_move_constructible_v =
388 is_trivially_move_constructible<T>::value;
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;
396 RANGES_INLINE_VAR
constexpr bool is_trivially_copy_assignable_v =
397 is_trivially_copy_assignable<T>::value;
399 RANGES_INLINE_VAR
constexpr bool is_trivially_move_assignable_v =
400 is_trivially_move_assignable<T>::value;
405 RANGES_INLINE_VAR
constexpr bool is_trivial_v =
406 is_trivially_copyable_v<T> &&
407 is_trivially_default_constructible_v<T>;
414#if RANGES_CXX_LIB_IS_FINAL > 0
415#if defined(__clang__) && !defined(_LIBCPP_VERSION)
417 RANGES_INLINE_VAR
constexpr bool is_final_v = __is_final(T);
425#if META_CXX_TRAIT_VARIABLE_TEMPLATES
426 using std::is_final_v;
429 RANGES_INLINE_VAR
constexpr bool is_final_v = is_final<T>::value;
434 RANGES_INLINE_VAR
constexpr bool is_final_v =
false;
437 using is_final = std::false_type;
443 char (&is_function_impl_(priority_tag<0>))[1];
446 template<
typename T,
typename = decltype((*(T *)0)[0])>
447 char (&is_function_impl_(priority_tag<1>))[2];
451 template<
typename T,
typename = T (*)()>
452 char (&is_function_impl_(priority_tag<2>))[3];
455 template<
typename T,
typename =
int T::*>
456 char (&is_function_impl_(priority_tag<3>))[4];
459 RANGES_INLINE_VAR
constexpr bool is_function_v =
460 sizeof(detail::is_function_impl_<T>(priority_tag<3>{})) == 1;
463 struct remove_rvalue_reference
469 struct remove_rvalue_reference<T &&>
481 template<
typename From,
typename To>
482 using is_convertible =
483 std::is_convertible<meta::_t<std::add_rvalue_reference<From>>, To>;
502#if __cplusplus > 201703L && __has_include(<compare>) && \
503 defined(__cpp_concepts) && defined(__cpp_impl_three_way_comparison)
504 struct compare_three_way;
507 template<
typename Pred>
510 enum cardinality : std::ptrdiff_t
517 template<
typename Rng,
typename Vo
id =
void>
520 template<
typename Rng>
523 template<
typename Rng>
526 template<
typename S,
typename I>
527 RANGES_INLINE_VAR
constexpr bool disable_sized_sentinel =
false;
530 RANGES_INLINE_VAR
constexpr bool enable_borrowed_range =
false;
535 RANGES_DEPRECATED(
"Please use ranges::enable_borrowed_range instead.")
536 RANGES_INLINE_VAR constexpr
bool enable_safe_range = enable_borrowed_range<R>;
539 using detail::enable_safe_range;
541 template<typename Cur>
544 template<typename Cur>
547 template<cardinality>
551 template<
typename Derived, cardinality C = finite>
554 template<
typename Derived,
typename BaseRng,
558 template<
typename I,
typename S>
565 struct cpp17_iterator_cursor;
572 template<
typename First,
typename Second>
581 template<
typename Derived, cardinality = finite>
587 template<
typename I,
typename S = I>
588 struct RANGES_EMPTY_BASES iterator_range;
590 template<
typename I,
typename S = I>
598 template<
typename Rng,
typename Pred>
603 struct adjacent_filter_fn;
606 template<
typename Rng,
typename Pred>
611 struct adjacent_remove_if_fn;
620 template<
typename Rng,
typename Fun>
628 template<
typename Rng>
652 template<typename Rng, bool = (bool)is_infinite<Rng>()>
664 struct reverse_cursor;
679 template<
typename Rng,
typename Fun>
687 template<
typename Rng>
697 template<
typename From,
typename To = unreachable_sentinel_t>
700 template<
typename From,
typename To = From>
706 struct closed_iota_fn;
709 template<
typename Rng>
712 template<
typename Rng,
typename ValRng>
720 template<
typename... Rngs>
728 template<
typename Rng,
typename Fun>
736 template<
typename Rng>
744 template<
typename Rng>
752 template<
typename Val>
760 template<
typename Rng>
768 template<
typename Rng>
784 template<
typename Rng>
792 template<
typename Rng>
800 template<
typename Rng>
811 template<
typename Rng>
812 struct is_random_access_common_;
814 template<
typename Rng,
815 bool IsRandomAccessCommon = is_random_access_common_<Rng>::value>
816 struct take_exactly_view_;
820 template<
typename Rng>
821 using take_exactly_view = detail::take_exactly_view_<Rng>;
825 struct take_exactly_fn;
828 template<
typename Rng,
typename Pred>
831 template<
typename Rng,
typename Pred>
836 struct iter_take_while_fn;
837 struct take_while_fn;
840 template<
typename Rng,
typename Regex,
typename SubMatchRange>
848 template<
typename Rng,
typename Fun>
851 template<
typename Rng,
typename Fun>
859 template<
typename Rng,
typename Val1,
typename Val2>
862 template<
typename Rng,
typename Pred,
typename Val>
869 struct replace_if_fn;
872 template<
typename Rng,
typename Pred>
888 template<
typename Rng>
896 template<
typename Rng>
899 template<
typename Rng>
909 template<
typename Fun,
typename... Rngs>
912 template<
typename Fun,
typename... Rngs>
915 template<
typename... Rngs>
920 struct iter_zip_with_fn;
931 namespace concepts = ::concepts;
932 using namespace ::concepts::defs;
933 using ::concepts::and_v;
939#include <range/v3/detail/epilogue.hpp>
std::integral_constant< bool, B > bool_
An integral constant wrapper for bool.
Definition meta.hpp:168
typename T::type _t
Type alias for T::type.
Definition meta.hpp:141
Definition adjacent_filter.hpp:63
Definition adjacent_remove_if.hpp:44
Definition operations.hpp:39
Definition basic_iterator.hpp:532
Definition basic_iterator.hpp:47
Definition range_fwd.hpp:549
Definition range_fwd.hpp:488
Definition chunk_by.hpp:50
An iota view in a closed range.
Definition iota.hpp:184
Definition common_iterator.hpp:69
Definition compose.hpp:33
Definition compressed_pair.hpp:124
Definition range_fwd.hpp:492
Definition counted.hpp:36
A placeholder for an iterator or a sentinel into a range that may no longer be valid.
Definition dangling.hpp:35
Definition default_sentinel.hpp:26
Definition operations.hpp:571
Definition range_fwd.hpp:490
Definition comparisons.hpp:28
Definition group_by.hpp:54
Definition identity.hpp:25
Definition associated_types.hpp:166
Definition indirect.hpp:84
Definition indirect.hpp:40
Definition associated_types.hpp:236
Definition istream.hpp:34
Definition operations.hpp:482
Definition take_while.hpp:45
Definition zip_with.hpp:167
Definition comparisons.hpp:50
Definition compressed_pair.hpp:175
Definition pipeable.hpp:46
Definition move_iterators.hpp:33
Definition range_fwd.hpp:494
Definition operations.hpp:301
Definition comparisons.hpp:39
Definition overload.hpp:60
Definition partial_sum.hpp:99
Definition partial_sum.hpp:74
Definition pipeable.hpp:76
Definition operations.hpp:335
Definition traits.hpp:128
Definition reference_wrapper.hpp:117
Definition reference_wrapper.hpp:76
Definition reverse.hpp:48
Definition range_fwd.hpp:591
Definition stride.hpp:132
Definition take_while.hpp:95
Definition tokenize.hpp:43
Definition unbounded.hpp:29
Definition unreachable_sentinel.hpp:27
Definition variant.hpp:621
Definition adaptor.hpp:475
Definition range_fwd.hpp:182
A utility for constructing a view from a (derived) type that implements begin and end cursors.
Definition facade.hpp:66
Definition interface.hpp:129
Definition zip_with.hpp:370