/// \file // Range v3 library // // Copyright Eric Niebler 2013-present // // Use, modification and distribution is subject to the // Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Project home: https://github.com/ericniebler/range-v3 // #ifndef RANGES_V3_RANGE_FWD_HPP #define RANGES_V3_RANGE_FWD_HPP #include #include #include #include #include #include #include /// \defgroup group-iterator Iterator /// Iterator functionality /// \defgroup group-range Range /// Core range functionality /// \defgroup group-algorithms Algorithms /// Iterator- and range-based algorithms, like the standard algorithms /// \defgroup group-views Views /// Lazy, non-owning, non-mutating, composable range views /// \defgroup group-actions Actions /// Eager, mutating, composable algorithms /// \defgroup group-utility Utility /// Utility classes /// \defgroup group-functional Functional /// Function and function object utilities /// \defgroup group-numerics Numerics /// Numeric utilities RANGES_DIAGNOSTIC_PUSH RANGES_DIAGNOSTIC_IGNORE_CXX17_COMPAT namespace ranges { /// \cond namespace views { } namespace actions { } // GCC either fails to accept an attribute on a namespace, or else // it ignores the deprecation attribute. Frustrating. #if(RANGES_CXX_VER < RANGES_CXX_STD_17 || defined(__GNUC__) && !defined(__clang__)) inline namespace v3 { using namespace ranges; } namespace view = views; namespace action = actions; #else inline namespace RANGES_DEPRECATED( "The name ranges::v3 namespace is deprecated. " "Please discontinue using it.") v3 { using namespace ranges; } namespace RANGES_DEPRECATED( "The ranges::view namespace has been renamed to ranges::views. " "(Sorry!)") view { using namespace views; } namespace RANGES_DEPRECATED( "The ranges::action namespace has been renamed to ranges::actions. " "(Sorry!)") action { using namespace actions; } #endif namespace _end_ { struct fn; } using end_fn = _end_::fn; namespace _size_ { struct fn; } template struct result_of; template using result_of_t RANGES_DEPRECATED( "ranges::result_of_t is deprecated. " "Please use ranges::invoke_result_t") = meta::_t>; /// \endcond template struct variant; struct dangling; struct make_pipeable_fn; struct pipeable_base; template struct composed; template struct overloaded; namespace actions { template struct action; } namespace views { template struct view; } struct advance_fn; struct advance_to_fn; struct advance_bounded_fn; struct next_fn; struct prev_fn; struct distance_fn; struct iter_size_fn; template struct readable_traits; template struct incrementable_traits; struct view_base {}; /// \cond namespace detail { template struct difference_type_; template struct value_type_; } // namespace detail template using difference_type RANGES_DEPRECATED( "ranges::difference_type::type is deprecated. Use " "ranges::incrementable_traits::difference_type instead.") = detail::difference_type_; template using value_type RANGES_DEPRECATED( "ranges::value_type::type is deprecated. Use " "ranges::readable_traits::value_type instead.") = detail::value_type_; template struct size_type; /// \endcond /// \cond namespace detail { struct ignore_t { ignore_t() = default; template constexpr ignore_t(T &&) noexcept {} template constexpr ignore_t const & operator=(T &&) const noexcept { return *this; } }; struct value_init { template operator T() const { return T{}; } }; struct make_compressed_pair_fn; template constexpr meta::_t> && move(T && t) noexcept { return static_cast> &&>(t); } struct as_const_fn { template constexpr T const & operator()(T & t) const noexcept { return t; } template constexpr T const && operator()(T && t) const noexcept { return (T &&) t; } }; RANGES_INLINE_VARIABLE(as_const_fn, as_const) template using as_const_t = decltype(as_const(std::declval())); template using decay_t = meta::_t>; template>> using as_ref_t = meta::_t>>>; template>> using as_cref_t = meta::_t>; struct get_first; struct get_second; template struct replacer_fn; template struct replacer_if_fn; template struct move_into_cursor; template struct from_end_; template constexpr int ignore_unused(Ts &&...) { return 42; } template struct priority_tag : priority_tag {}; template<> struct priority_tag<0> {}; template using is_trivial = meta::bool_< #if META_CXX_TRAIT_VARIABLE_TEMPLATES std::is_trivially_copyable_v && std::is_trivially_default_constructible_v>; #else std::is_trivially_copyable::value && std::is_trivially_default_constructible::value>; #endif #if defined(__clang__) && !defined(_LIBCPP_VERSION) template using is_trivially_constructible = meta::bool_<__is_trivially_constructible(T, Args...)>; template using is_trivially_default_constructible = is_trivially_constructible; template using is_trivially_copy_constructible = is_trivially_constructible; template using is_trivially_move_constructible = is_trivially_constructible; template using is_trivially_assignable = meta::bool_<__is_trivially_assignable(T, U)>; template using is_trivially_copy_assignable = is_trivially_assignable; template using is_trivially_move_assignable = is_trivially_assignable; template using is_trivially_copyable = meta::bool_<__is_trivially_copyable(T)>; #else template using is_trivially_default_constructible = std::is_trivially_constructible; using std::is_trivially_copy_assignable; using std::is_trivially_copy_constructible; using std::is_trivially_copyable; using std::is_trivially_move_assignable; using std::is_trivially_move_constructible; #endif #if RANGES_CXX_LIB_IS_FINAL > 0 #if defined(__clang__) && !defined(_LIBCPP_VERSION) template using is_final = meta::bool_<__is_final(T)>; #else using std::is_final; #endif #else template using is_final = std::false_type; #endif // Work around libc++'s buggy std::is_function // Function types here: template char (&is_function_impl_(priority_tag<0>))[1]; // Array types here: template char (&is_function_impl_(priority_tag<1>))[2]; // Anything that can be returned from a function here (including // void and reference types): template char (&is_function_impl_(priority_tag<2>))[3]; // Classes and unions (including abstract types) here: template char (&is_function_impl_(priority_tag<3>))[4]; template RANGES_INLINE_VAR constexpr bool is_function_v = sizeof(detail::is_function_impl_(priority_tag<3>{})) == 1; template struct remove_rvalue_reference { using type = T; }; template struct remove_rvalue_reference { using type = T; }; template using remove_rvalue_reference_t = meta::_t>; // Workaround bug in the Standard Library: // From cannot be an incomplete class type despite that // is_convertible should be equivalent to is_convertible // in such a case. template using is_convertible = std::is_convertible>, To>; } // namespace detail /// \endcond struct begin_tag {}; struct end_tag {}; struct copy_tag {}; struct move_tag {}; template using uncvref_t = meta::_t>>>; struct not_equal_to; struct equal_to; struct less; struct identity; template struct logical_negate; enum cardinality : std::ptrdiff_t { infinite = -3, unknown = -2, finite = -1 }; template struct range_cardinality; template using is_finite = meta::bool_::value >= finite>; template using is_infinite = meta::bool_::value == infinite>; template RANGES_INLINE_VAR constexpr bool disable_sized_sentinel = false; template struct basic_mixin; template struct RANGES_EMPTY_BASES basic_iterator; template struct basic_view : view_base {}; template struct view_facade; template::value> struct view_adaptor; template struct common_iterator; /// \cond namespace detail { template struct cpp17_iterator_cursor; template using cpp17_iterator = basic_iterator>; } // namespace detail /// \endcond template struct compressed_pair; template struct bind_element; template using bind_element_t = meta::_t>; template struct view_interface; template struct istream_view; template struct RANGES_EMPTY_BASES iterator_range; template struct sized_iterator_range; template struct reference_wrapper; // Views // template struct RANGES_EMPTY_BASES adjacent_filter_view; namespace views { struct adjacent_filter_fn; } template struct RANGES_EMPTY_BASES adjacent_remove_if_view; namespace views { struct adjacent_remove_if_fn; } namespace views { struct all_fn; } template struct const_view; namespace views { struct const_fn; } template struct counted_view; namespace views { struct counted_fn; } struct default_sentinel_t; template struct move_iterator; template using move_into_iterator = basic_iterator>; template()> struct RANGES_EMPTY_BASES cycled_view; namespace views { struct cycle_fn; } /// \cond namespace detail { template struct reverse_cursor; } /// \endcond template using reverse_iterator = basic_iterator>; template struct empty_view; namespace views { struct empty_fn; } template struct group_by_view; namespace views { struct group_by_fn; } template struct indirect_view; namespace views { struct indirect_fn; } struct unreachable_sentinel_t; template struct iota_view; template struct closed_iota_view; namespace views { struct iota_fn; struct closed_iota_fn; } // namespace views template struct join_view; template struct join_with_view; namespace views { struct join_fn; } template struct concat_view; namespace views { struct concat_fn; } template struct partial_sum_view; namespace views { struct partial_sum_fn; } template struct move_view; namespace views { struct move_fn; } template struct ref_view; namespace views { struct ref_fn; } template struct repeat_view; namespace views { struct repeat_fn; } template struct RANGES_EMPTY_BASES reverse_view; namespace views { struct reverse_fn; } template struct slice_view; namespace views { struct slice_fn; } // template // struct split_view; // namespace views // { // struct split_fn; // } template struct single_view; namespace views { struct single_fn; } template struct stride_view; namespace views { struct stride_fn; } template struct take_view; namespace views { struct take_fn; } /// \cond namespace detail { template struct is_random_access_common_; template::value> struct take_exactly_view_; } // namespace detail /// \endcond template using take_exactly_view = detail::take_exactly_view_; namespace views { struct take_exactly_fn; } template struct iter_take_while_view; template struct take_while_view; namespace views { struct iter_take_while_fn; struct take_while_fn; } // namespace views template struct tokenize_view; namespace views { struct tokenize_fn; } template struct iter_transform_view; template struct transform_view; namespace views { struct transform_fn; } template using replace_view = iter_transform_view>; template using replace_if_view = iter_transform_view>; namespace views { struct replace_fn; struct replace_if_fn; } // namespace views template struct trim_view; namespace views { struct trim_fn; } template struct unbounded_view; namespace views { struct unbounded_fn; } template using unique_view = adjacent_filter_view>; namespace views { struct unique_fn; } template using keys_range_view = transform_view; template using values_view = transform_view; namespace views { struct keys_fn; struct values_fn; } // namespace views template struct iter_zip_with_view; template struct zip_with_view; template struct zip_view; namespace views { struct iter_zip_with_fn; struct zip_with_fn; struct zip_fn; } // namespace views } // namespace ranges namespace ranges { namespace concepts = ::concepts; using namespace ::concepts::defs; using ::concepts::and_v; // namespace lazy // { // using namespace ::concepts::defs::lazy; // } namespace defer { using namespace ::concepts::defs::defer; } } // namespace ranges RANGES_DIAGNOSTIC_POP /// \endcond #endif