Range-v3
Range algorithms, views, and actions for the Standard Library
Views

Description

Lazy, non-owning, non-mutating, composable range views.

Classes

struct  ranges::adaptor_base
 
struct  ranges::adaptor_cursor< BaseIter, Adapt >
 
struct  ranges::adaptor_sentinel< BaseSent, Adapt >
 
struct  ranges::adjacent_filter_view< Rng, Pred >
 
struct  ranges::adjacent_remove_if_view< Rng, Pred >
 
struct  ranges::any_view< Ref, Cat, enable >
 A type-erased view. More...
 
struct  ranges::base_adaptor_sentinel< BaseSent, Adapt >
 
struct  ranges::cache1_view< Rng >
 
struct  ranges::cartesian_product_view< Views >
 
struct  ranges::chunk_view< Rng >
 
struct  ranges::chunk_view_< Rng, IsForwardRange >
 
struct  ranges::chunk_view_< Rng, false >
 
struct  ranges::closed_iota_view< From, To >
 An iota view in a closed range. More...
 
struct  ranges::common_view< Rng, bool >
 
struct  ranges::common_view< Rng, true >
 
struct  ranges::concat_view< Rngs >
 
struct  ranges::const_view< Rng >
 
struct  ranges::counted_view< I >
 
struct  ranges::cycled_view< Rng, bool >
 
struct  ranges::cycled_view< Rng, true >
 
struct  ranges::delimit_view< Rng, Val >
 
struct  ranges::drop_exactly_view< Rng >
 
struct  ranges::drop_last_view< Rng, typename >
 
struct  ranges::drop_last_view< Rng, detail::drop_last_view::mode_bidi >
 
struct  ranges::drop_last_view< Rng, detail::drop_last_view::mode_forward >
 
struct  ranges::drop_last_view< Rng, detail::drop_last_view::mode_sized >
 
struct  ranges::drop_view< Rng >
 
struct  ranges::drop_while_view< Rng, Pred >
 
struct  ranges::empty_view< T >
 
struct  ranges::exclusive_scan_view< Rng, T, Fun >
 
struct  ranges::filter_view< Rng, Pred >
 
struct  ranges::generate_n_view< G >
 
struct  ranges::generate_view< G >
 
struct  ranges::getlines_fn
 
struct  ranges::getlines_view
 
struct  ranges::group_by_view< Rng, Fun >
 
struct  ranges::identity_adaptor< Rng >
 
struct  ranges::intersperse_view< Rng >
 
struct  ranges::iota_view< From, To >
 
struct  ranges::istream_view< Val >
 
struct  ranges::iter_take_while_view< Rng, Pred >
 
struct  ranges::iter_transform2_view< Rng1, Rng2, Fun >
 
struct  ranges::iter_transform_view< Rng, Fun >
 
struct  ranges::iter_zip_with_view< Fun, Rngs >
 
struct  ranges::join_view< Rng >
 
struct  ranges::join_with_view< Rng, ValRng >
 
struct  ranges::make_subrange_fn
 
struct  ranges::make_view_fn
 
struct  ranges::move_view< Rng >
 
struct  ranges::partial_sum_view< Rng, Fun >
 
struct  ranges::ref_view< Rng >
 
struct  ranges::remove_if_view< Rng, Pred >
 
struct  ranges::repeat_n_view< Val >
 
struct  ranges::repeat_view< Val >
 
struct  ranges::reverse_view< Rng >
 
struct  ranges::reverse_view< reverse_view< Rng > >
 
class  ranges::sample_view< Rng, URNG >
 
struct  ranges::single_view< T >
 
struct  ranges::slice_view< Rng >
 
struct  ranges::sliding_view< Rng, sliding_view_detail::cache::first >
 
struct  ranges::sliding_view< Rng, sliding_view_detail::cache::last >
 
struct  ranges::sliding_view< Rng, sliding_view_detail::cache::none >
 
struct  ranges::span< T, N >
 
struct  ranges::split_view< V, Pattern >
 
struct  ranges::split_when_view< Rng, Fun >
 
struct  ranges::stride_view< Rng >
 
struct  ranges::subrange< I, S, K >
 
struct  ranges::tail_view< Rng >
 
struct  ranges::take_while_view< Rng, Pred >
 
struct  ranges::tokenize_view< Rng, Regex, SubMatchRange >
 
struct  ranges::transform2_view< Rng1, Rng2, Fun >
 
struct  ranges::transform_view< Rng, Fun >
 
struct  ranges::trim_view< Rng, Pred >
 
struct  ranges::unbounded_view< I >
 
struct  ranges::view_adaptor< Derived, BaseRng, Cardinality >
 
struct  ranges::view_facade< Derived, Cardinality >
 A utility for constructing a view from a (derived) type that implements begin and end cursors. More...
 
struct  ranges::view_interface< Derived, Cardinality >
 
struct  ranges::views::c_str_fn
 View a \0-terminated C string (e.g. from a const char*) as a range. More...
 
struct  ranges::views::generate_fn
 
struct  ranges::views::intersperse_fn
 
struct  ranges::views::linear_distribute_fn
 Distributes n values linearly in the closed interval [from, to]. More...
 
struct  ranges::views::linear_distribute_view< T >
 
struct  ranges::views::ref_fn
 
struct  ranges::zip_view< Rngs >
 
struct  ranges::zip_with_view< Fun, Rngs >
 

Typedefs

template<typename D >
using ranges::adaptor_cursor_t = adaptor_cursor< detail::adapted_iterator_t< D >, detail::begin_adaptor_t< D > >
 
template<typename D >
using ranges::adaptor_sentinel_t = meta::if_c< same_as< detail::adapted_iterator_t< D >, detail::adapted_sentinel_t< D > > &&same_as< detail::begin_adaptor_t< D >, detail::end_adaptor_t< D > >, adaptor_cursor_t< D >, adaptor_sentinel< detail::adapted_sentinel_t< D >, detail::end_adaptor_t< D > >>
 
using ranges::span< T, N >::difference_type = index_type
 
using ranges::span< T, N >::element_type = T
 
using ranges::span< T, N >::index_type = detail::span_index_t
 
using ranges::span< T, N >::iterator = T *
 
using ranges::span< T, N >::pointer = T *
 
template<typename Rng >
using ranges::cpp20::ref_view = ranges::ref_view< Rng >
 
using ranges::span< T, N >::reference = T &
 
using ranges::span< T, N >::reverse_iterator = ranges::reverse_iterator< iterator >
 
template<typename R >
using ranges::safe_subrange_t = detail::maybe_dangling_< R, subrange< iterator_t< R > >>
 
template<typename Rng >
using ranges::take_exactly_view = detail::take_exactly_view_< Rng >
 
using ranges::span< T, N >::value_type = meta::_t< std::remove_cv< T > >
 

Enumerations

enum  subrange_kind : bool { unsized, sized }
 

Functions

constexpr auto ranges::intersperse_view< Rng >::cursor_adaptor< Const >::advance (iterator_t< CRng > &it, range_difference_t< CRng > n) -> void requires random_access_range< CRng >
 
template<typename T , detail::span_index_t N>
span< unsigned char const, detail::byte_size< T >N)> ranges::as_bytes (span< T, N > s) noexcept
 
template<typename T , detail::span_index_t N>
span< unsigned char, detail::byte_size< T >N)> ranges::as_writeable_bytes (span< T, N > s) noexcept
 
constexpr Rng & ranges::ref_view< Rng >::base () const noexcept
 
constexpr iterator ranges::span< T, N >::begin () const noexcept
 
constexpr iterator_t< Rng > ranges::ref_view< Rng >::begin () const noexcept(noexcept(ranges::begin(*rng_)))
 
template<typename View >
constexpr iterator_t< CRng > ranges::intersperse_view< Rng >::cursor_adaptor< Const >::begin (View &view)
 
result_t & ranges::generate_view< G >::cached ()
 
 ranges::CPP_PP_CAT (CPP_PP_DEF_, template(typename IsConst, typename...Views)) META_CONCEPT CPP_PP_CAT(CPP_PP_DEF_
 
 ranges::CPP_PP_CAT (CPP_PP_DEF_, template(typename Rng)) META_CONCEPT CPP_PP_CAT(CPP_PP_DEF_
 
 ranges::CPP_PP_CAT (CPP_PP_DEF_, template(typename...Views)) META_CONCEPT CPP_PP_CAT(CPP_PP_DEF_
 
 ranges::generate_view< G >::cursor::cursor (generate_view *view)
 
template<bool Other>
requires Const &&!Other ranges::intersperse_view< Rng >::cursor_adaptor< Const >::cursor_adaptor (cursor_adaptor< Other > that)
 
constexpr ranges::intersperse_view< Rng >::cursor_adaptor< Const >::cursor_adaptor (range_value_t< Rng > const &val)
 
constexpr pointer ranges::span< T, N >::data () const noexcept
 
constexpr auto ranges::ref_view< Rng >::data () const noexcept(noexcept(ranges::data(*rng_))) requires contiguous_range< Rng >
 
constexpr auto ranges::intersperse_view< Rng >::cursor_adaptor< Const >::distance_to (iterator_t< CRng > const &it, iterator_t< CRng > const &other_it, cursor_adaptor const &other) const -> range_difference_t< Rng > requires sized_sentinel_for< iterator_t< CRng >, iterator_t< CRng >>
 
constexpr bool ranges::span< T, N >::empty () const noexcept
 
constexpr auto ranges::ref_view< Rng >::empty () const noexcept(noexcept(ranges::empty(*rng_))) -> bool requires detail::can_empty_< Rng >
 
static constexpr bool ranges::intersperse_view< Rng >::sentinel_adaptor< Const >::empty (iterator_t< CRng > const &it, cursor_adaptor< Const > const &, sentinel_t< CRng > const &sent)
 
constexpr iterator ranges::span< T, N >::end () const noexcept
 
constexpr sentinel_t< Rng > ranges::ref_view< Rng >::end () const noexcept(noexcept(ranges::end(*rng_)))
 
constexpr auto ranges::intersperse_view< Rng >::cursor_adaptor< Const >::equal (iterator_t< CRng > const &it0, iterator_t< CRng > const &it1, cursor_adaptor const &other) const -> bool requires sentinel_for< iterator_t< CRng >, iterator_t< CRng >>
 
template<index_type Count>
constexpr span< T, Count > ranges::span< T, N >::first () const noexcept
 
constexpr span< T > ranges::span< T, N >::first (index_type cnt) const noexcept
 
 ranges::generate_view< G >::generate_view (G g)
 
constexpr ranges::intersperse_view< Rng >::intersperse_view (Rng rng, range_value_t< Rng > val)
 
template<typename Val >
auto ranges::istream (std::istream &sin) -> istream_view< Val > requires copy_constructible< Val > &&default_constructible< Val >
 
template<index_type Count>
constexpr span< T, Count > ranges::span< T, N >::last () const noexcept
 
constexpr span< T > ranges::span< T, N >::last (index_type cnt) const noexcept
 
constexpr ranges::views::linear_distribute_view< T >::linear_distribute_view (T from, T to__, std::ptrdiff_t n) noexcept
 
template<typename ElementType >
constexpr span< ElementType > ranges::make_span (ElementType *first, ElementType *last) noexcept
 
template<typename ElementType >
constexpr span< ElementType > ranges::make_span (ElementType *ptr, detail::span_index_t cnt) noexcept
 
void ranges::generate_view< G >::cursor::next ()
 
constexpr void ranges::intersperse_view< Rng >::cursor_adaptor< Const >::next (iterator_t< CRng > &it)
 
template<typename U , index_type M>
auto ranges::span< T, N >::operator!= (span< U, M > const &that) const -> bool requires equality_comparable_with< T, U >
 
template<typename Char >
auto ranges::views::c_str_fn::operator() (Char *sz) const volatile -> ranges::delimit_view< ranges::subrange< Char *, ranges::unreachable_sentinel_t >, meta::_t< std::remove_cv< Char >>> requires detail::is_char_type< Char >::value
 
template<typename Char , std::size_t N>
auto ranges::views::c_str_fn::operator() (Char(&sz)[N]) const -> ranges::subrange< Char * > requires detail::is_char_type< Char >::value
 
template<typename G >
auto ranges::views::generate_fn::operator() (G g) const -> generate_view< G > requires invocable< G & > &&copy_constructible< G > &&std::is_object< detail::decay_t< invoke_result_t< G & >>>::value &&constructible_from< detail::decay_t< invoke_result_t< G & >>, invoke_result_t< G & >> &&assignable_from< detail::decay_t< invoke_result_t< G & >> &, invoke_result_t< G & >>
 
template<typename Rng >
constexpr auto ranges::views::intersperse_fn::operator() (Rng &&rng, range_value_t< Rng > val) const -> intersperse_view< all_t< Rng >> requires viewable_range< Rng > &&input_range< Rng > &&convertible_to< range_reference_t< Rng >, range_value_t< Rng >> &&semiregular< range_value_t< Rng >>
 
template<typename Rng >
constexpr auto ranges::views::ref_fn::operator() (Rng &rng) const noexcept -> ref_view< Rng > requires range< Rng >
 
template<typename Rng >
void ranges::views::ref_fn::operator() (Rng const &&rng) const =delete
 
template<typename U , index_type M>
auto ranges::span< T, N >::operator< (span< U, M > const &that) const -> bool requires totally_ordered_with< T, U >
 
template<typename U , index_type M>
auto ranges::span< T, N >::operator<= (span< U, M > const &that) const -> bool requires totally_ordered_with< T, U >
 
template<typename U , index_type M>
auto ranges::span< T, N >::operator== (span< U, M > const &that) const -> bool requires equality_comparable_with< T, U >
 
template<typename U , index_type M>
auto ranges::span< T, N >::operator> (span< U, M > const &that) const -> bool requires totally_ordered_with< T, U >
 
template<typename U , index_type M>
auto ranges::span< T, N >::operator>= (span< U, M > const &that) const -> bool requires totally_ordered_with< T, U >
 
constexpr reference ranges::span< T, N >::operator[] (index_type idx) const noexcept
 
constexpr auto ranges::intersperse_view< Rng >::cursor_adaptor< Const >::prev (iterator_t< CRng > &it) -> void requires bidirectional_range< CRng >
 
constexpr reverse_iterator ranges::span< T, N >::rbegin () const noexcept
 
result_t && ranges::generate_view< G >::cursor::read () const
 
constexpr range_value_t< Rng > ranges::intersperse_view< Rng >::cursor_adaptor< Const >::read (iterator_t< CRng > const &it) const
 
constexpr ranges::ref_view< Rng >::ref_view (Rng &rng) noexcept
 
constexpr reverse_iterator ranges::span< T, N >::rend () const noexcept
 
template<typename Rng >
 ranges::span< T, N >::requires (!defer::same_as< span, uncvref_t< Rng >>) &&defer
 
template<bool Other>
requires Const &&!Other ranges::intersperse_view< Rng >::sentinel_adaptor< Const >::sentinel_adaptor (sentinel_adaptor< Other >)
 
template<typename Rng >
constexpr bool ranges::simple_view ()
 
constexpr std::size_t ranges::views::linear_distribute_view< T >::size () const noexcept
 
constexpr auto ranges::ref_view< Rng >::size () const noexcept(noexcept(ranges::size(*rng_))) requires sized_range< Rng >
 
constexpr auto ranges::intersperse_view< Rng >::size () const requires sized_range< Rng const >
 
constexpr auto ranges::intersperse_view< Rng >::size () requires sized_range< Rng >
 
constexpr index_type ranges::span< T, N >::size_bytes () const noexcept
 
template<typename = void>
constexpr ranges::span< T, N >::span (pointer first, pointer last) noexcept
 
constexpr ranges::span< T, N >::span (pointer ptr, index_type cnt) noexcept
 
template<index_type Offset, index_type Count>
constexpr span< T, detail::subspan_extent(N, Offset, Count)> ranges::span< T, N >::subspan () const noexcept
 
template<index_type Offset>
constexpr span< T,(N >=Offset ? N - Offset :dynamic_extent)> ranges::span< T, N >::subspan () const noexcept
 
constexpr span< T, dynamic_extent > ranges::span< T, N >::subspan (index_type offset) const noexcept
 
constexpr span< T, dynamic_extent > ranges::span< T, N >::subspan (index_type offset, index_type cnt) const noexcept
 

Variables

constexpr view< addressof_fnaddressof {}
 
constexpr view< adjacent_filter_fnadjacent_filter {}
 
constexpr view< adjacent_remove_if_fnadjacent_remove_if {}
 
constexpr view< all_fnall {}
 
constexpr c_str_fn c_str {}
 
constexpr view< cache1_fncache1 {}
 
concept ranges::cartesian_produce_view_can_bidi = CPP_PP_CAT( CPP_PP_DEF_IMPL_IS_PAREN_, 0 )( cartesian_produce_view_can_random<IsConst )( cartesian_produce_view_can_random<IsConst, Views...> || and_v<common_range<meta::const_if<IsConst, Views>>..., bidirectional_iterator<iterator_t< meta::const_if<IsConst, Views>>>...> )
 
concept ranges::cartesian_produce_view_can_const = CPP_PP_CAT( CPP_PP_DEF_IMPL_IS_PAREN_, 0 )( and_v<range<Views const>...> )( and_v<range<Views const>...> )
 
concept ranges::cartesian_produce_view_can_distance = CPP_PP_CAT( CPP_PP_DEF_IMPL_IS_PAREN_, 0 )( cartesian_produce_view_can_size<IsConst )( cartesian_produce_view_can_size<IsConst, Views...> && and_v<sized_sentinel_for< iterator_t<meta::const_if<IsConst, Views>>, iterator_t<meta::const_if<IsConst, Views>>>...> )
 
concept ranges::cartesian_produce_view_can_random = CPP_PP_CAT( CPP_PP_DEF_IMPL_IS_PAREN_, 0 )( cartesian_produce_view_can_distance<IsConst )( cartesian_produce_view_can_distance<IsConst, Views...> && and_v<random_access_iterator<iterator_t< meta::const_if<IsConst, Views>>>...> )
 
concept ranges::cartesian_produce_view_can_size = CPP_PP_CAT( CPP_PP_DEF_IMPL_IS_PAREN_, 0 )( and_v<sized_range<meta::const_if<IsConst )( and_v<sized_range<meta::const_if<IsConst, Views>>...> && ranges::type<common_type_t<std::uintmax_t, range_size_t<meta::const_if<IsConst, Views>>...>> )
 
constexpr view< chunk_fnchunk {}
 
constexpr closed_indices_fn closed_indices {}
 
constexpr closed_iota_fn closed_iota {}
 
constexpr view< common_fncommon {}
 
constexpr concat_fn concat {}
 
constexpr view< const_fnconst_ {}
 
constexpr counted_fn counted {}
 
constexpr view< cycle_fncycle {}
 
constexpr delimit_fn delimit {}
 
template<typename Rng , typename Pred >
constexpr bool ranges::disable_sized_range< trim_view< Rng, Pred > > = true
 
constexpr view< drop_fndrop {}
 
constexpr view< drop_exactly_fndrop_exactly {}
 
constexpr view< drop_while_fndrop_while {}
 
constexpr detail::span_index_t ranges::dynamic_extent = -1
 
constexpr view< enumerate_fnenumerate {}
 
constexpr view< exclusive_scan_fnexclusive_scan {}
 
static constexpr index_type ranges::span< T, N >::extent = N
 
constexpr view< filter_fnfilter {}
 
constexpr view< for_each_fnfor_each {}
 
constexpr generate_fn generate {}
 
constexpr generate_n_fn generate_n {}
 
constexpr getlines_fn ranges::getlines {}
 
constexpr view< group_by_fngroup_by {}
 
constexpr indices_fn indices {}
 
constexpr view< intersperse_fnintersperse {}
 
constexpr ints_fn ints {}
 
constexpr iota_fn iota {}
 
constexpr view< iter_take_while_fniter_take_while {}
 
constexpr view< iter_transform_fniter_transform {}
 
constexpr iter_zip_with_fn iter_zip_with {}
 
constexpr view< join_fnjoin {}
 
constexpr view< keys_fnkeys {}
 
constexpr lazy_yield_if_fn lazy_yield_if {}
 
constexpr linear_distribute_fn linear_distribute {}
 
constexpr make_subrange_fn make_subrange {}
 
constexpr make_view_fn ranges::make_view {}
 
constexpr view< move_fnmove {}
 
constexpr view< partial_sum_fnpartial_sum {}
 
constexpr view< ref_fnref {}
 
constexpr view< remove_fnremove {}
 
constexpr view< remove_if_fnremove_if {}
 
constexpr repeat_fn repeat {}
 
constexpr repeat_n_fn repeat_n {}
 
constexpr view< replace_fnreplace {}
 
constexpr view< replace_if_fnreplace_if {}
 
constexpr view< reverse_fnreverse {}
 
constexpr view< sample_fnsample {}
 
constexpr view< set_difference_fnset_difference {}
 
constexpr view< set_intersection_fnset_intersection {}
 
constexpr view< set_symmetric_difference_fnset_symmetric_difference {}
 
constexpr view< set_union_fnset_union {}
 
constexpr shared_fn shared {}
 
concept ranges::simple_view_ = CPP_PP_CAT( CPP_PP_DEF_IMPL_IS_PAREN_, 0 )( view_<Rng> && range<Rng const> && same_as<iterator_t<Rng> )( view_<Rng> && range<Rng const> && same_as<iterator_t<Rng>, iterator_t<Rng const>> && same_as<sentinel_t<Rng>, sentinel_t<Rng const>> )
 
constexpr single_fn single {}
 
constexpr view< slice_fn > slice {}
 
constexpr view< sliding_fnsliding {}
 
constexpr view< split_fnsplit {}
 
constexpr view< split_when_fnsplit_when {}
 
constexpr view< stride_fnstride {}
 
constexpr view< tail_fntail {}
 
constexpr view< take_fntake {}
 
constexpr view< take_exactly_fntake_exactly {}
 
constexpr view< take_last_fntake_last {}
 
constexpr view< take_while_fntake_while {}
 
constexpr tokenize_fn tokenize {}
 
constexpr view< transform_fntransform {}
 
constexpr view< trim_fntrim {}
 
constexpr unbounded_fn unbounded {}
 
constexpr view< unique_fnunique {}
 
constexpr view< values_fnvalues {}
 
constexpr yield_fn yield {}
 
constexpr yield_from_fn yield_from {}
 
constexpr yield_if_fn yield_if {}
 
constexpr zip_fn zip {}
 
constexpr zip_with_fn zip_with {}
 

Friends

struct ranges::intersperse_view< Rng >::cursor_adaptor< Const >::cursor_adaptor<!Const >
 

Variable Documentation

◆ make_view

constexpr make_view_fn ranges::make_view {}
constexpr