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_closure_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_base_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_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)
constexpr iterator | ranges::span< T, N >::begin () const noexcept
result_t & | ranges::generate_view< G >::cached ()
| ranges::generate_view< G >::cursor::cursor (generate_view *view)
constexpr | ranges::intersperse_view< Rng >::cursor_adaptor< Const >::cursor_adaptor (range_value_t< Rng > const &val)
template<bool Other>
requires Const &&!Other | ranges::intersperse_view< Rng >::cursor_adaptor< Const >::cursor_adaptor (cursor_adaptor< Other > that)
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 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 bool | ranges::span< T, N >::empty () const noexcept
constexpr sentinel_t< Rng > | ranges::ref_view< Rng >::end () const noexcept(noexcept(ranges::end(*rng_)))
constexpr iterator | ranges::span< T, N >::end () const noexcept
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 >>
| 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 >
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 *ptr, detail::span_index_t cnt) noexcept
template<typename ElementType >
constexpr span< ElementType > | ranges::make_span (ElementType *first, ElementType *last) 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 , 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 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 Rng >
constexpr auto | ranges::views::ref_fn::operator() (Rng &rng) const noexcept -> ref_view< Rng > requires range< Rng >
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 >
void | ranges::views::ref_fn::operator() (Rng const &&rng) const =delete
template<typename Rng >
constexpr auto | ranges::views::intersperse_base_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 T >
constexpr auto | ranges::views::intersperse_fn::operator() (T t) const requires copyable< T >
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<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 () noexcept
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 auto | ranges::ref_view< Rng >::size () const noexcept(noexcept(ranges::size(*rng_))) requires sized_range< Rng >
constexpr std::size_t | ranges::views::linear_distribute_view< T >::size () const noexcept
constexpr index_type | ranges::span< T, N >::size_bytes () const noexcept
constexpr | ranges::span< T, N >::span (pointer ptr, index_type cnt) noexcept

## Variables

constexpr view_closure< addressof_fn > | addressof {}
constexpr adjacent_filter_fn | adjacent_filter {}
constexpr adjacent_remove_if_fn | adjacent_remove_if {}
constexpr view_closure< all_fn > | all {}
constexpr c_str_fn | c_str {}
constexpr view_closure< cache1_fn > | cache1 {}
template<typename IsConst , typename... Views>
concept | ranges::cartesian_produce_view_can_bidi
template<typename IsConst , typename... Views>
concept | ranges::cartesian_produce_view_can_bidi_ = and_v<common_range<meta::const_if<IsConst, Views>>..., bidirectional_iterator<iterator_t<meta::const_if<IsConst, Views>>>...>
template<typename... Views>
concept | ranges::cartesian_produce_view_can_const
template<typename IsConst , typename... Views>
concept | ranges::cartesian_produce_view_can_distance
template<typename IsConst , typename... Views>
concept | ranges::cartesian_produce_view_can_distance_ = and_v<sized_sentinel_for< iterator_t<meta::const_if<IsConst, Views>>, iterator_t<meta::const_if<IsConst, Views>>>...>
template<typename IsConst , typename... Views>
concept | ranges::cartesian_produce_view_can_random
template<typename IsConst , typename... Views>
concept | ranges::cartesian_produce_view_can_random_ = and_v<random_access_iterator<iterator_t<meta::const_if<IsConst, Views>>>...>
template<typename IsConst , typename... Views>
concept | ranges::cartesian_produce_view_can_size
template<typename IsConst , typename... Views>
concept | ranges::cartesian_produce_view_can_size_ = and_v<common_with<std::uintmax_t, range_size_t<meta::const_if<IsConst, Views>>>...>
constexpr chunk_fn | chunk {}
constexpr closed_indices_fn | closed_indices {}
constexpr closed_iota_fn | closed_iota {}
constexpr view_closure< common_fn > | common {}
constexpr concat_fn | concat {}
constexpr view_closure< const_fn > | const_ {}
constexpr counted_fn | counted {}
constexpr view_closure< cycle_fn > | cycle {}
| ranges::span< T, N >::data_
constexpr delimit_fn | delimit {}
template<typename Rng , typename Pred >
constexpr bool | ranges::disable_sized_range< trim_view< Rng, Pred > > = true
constexpr drop_fn | drop {}
constexpr drop_exactly_fn | drop_exactly {}
constexpr drop_while_fn | drop_while {}
constexpr detail::span_index_t | ranges::dynamic_extent = -1
template<typename From , typename To >
constexpr bool | ranges::enable_safe_range< closed_iota_view< From, To > > = true
template<typename T >
constexpr bool | ranges::enable_safe_range< empty_view< T > > = true
template<typename From , typename To >
constexpr bool | ranges::enable_safe_range< iota_view< From, To > > = true
template<typename I , typename S , subrange_kind K>
constexpr bool | ranges::enable_safe_range< subrange< I, S, K > > = true
constexpr view_closure< enumerate_fn > | enumerate {}
constexpr exclusive_scan_fn | exclusive_scan {}
static constexpr index_type | ranges::span< T, N >::extent = N
constexpr filter_fn | filter {}
constexpr for_each_fn | for_each {}
constexpr generate_fn | generate {}
constexpr generate_n_fn | generate_n {}
constexpr getlines_fn | ranges::getlines {}
constexpr group_by_fn | group_by {}
constexpr indices_fn | indices {}
constexpr intersperse_fn | intersperse {}
constexpr ints_fn | ints {}
template<typename ViewFn , typename Rng >
concept | ranges::invocable_view_closure
template<typename ViewFn , typename Rng >
concept | ranges::invocable_view_closure_ = !derived_from<invoke_result_t<ViewFn, Rng>, detail::view_closure_base_>
constexpr iota_fn | iota {}
constexpr iter_take_while_fn | iter_take_while {}
constexpr iter_transform_fn | iter_transform {}
constexpr iter_zip_with_fn | iter_zip_with {}
constexpr view_closure< join_fn > | join {}
constexpr view_closure< keys_fn > | keys {}
constexpr lazy_yield_if_fn | lazy_yield_if {}
constexpr linear_distribute_fn | linear_distribute {}
constexpr make_subrange_fn | make_subrange {}
constexpr make_view_closure_fn | ranges::make_view_closure {}
constexpr view_closure< move_fn > | move {}
constexpr view_closure< partial_sum_fn > | partial_sum {}
constexpr ref_fn | ref {}
constexpr remove_fn | remove {}
constexpr remove_if_fn | remove_if {}
constexpr repeat_fn | repeat {}
constexpr repeat_n_fn | repeat_n {}
constexpr replace_fn | replace {}
constexpr replace_if_fn | replace_if {}
constexpr view_closure< reverse_fn > | reverse {}
constexpr sample_fn | sample {}
constexpr set_difference_fn | set_difference {}
constexpr set_intersection_fn | set_intersection {}
constexpr set_symmetric_difference_fn | set_symmetric_difference {}
constexpr set_union_fn | set_union {}
constexpr shared_closure< shared_fn > | shared {}
template<typename Rng >
concept | ranges::simple_view_
template<typename Rng >
concept | ranges::simple_view_frag_ = same_as<iterator_t<Rng>, iterator_t<Rng const>> && same_as<sentinel_t<Rng>, sentinel_t<Rng const>>
constexpr single_fn | single {}
constexpr slice_fn | slice {}
constexpr sliding_fn | sliding {}
constexpr split_fn | split {}
constexpr split_when_fn | split_when {}
constexpr stride_fn | stride {}
constexpr view_closure< tail_fn > | tail {}
constexpr take_fn | take {}
constexpr take_exactly_fn | take_exactly {}
constexpr take_last_fn | take_last {}
constexpr take_while_fn | take_while {}
constexpr tokenize_fn | tokenize {}
constexpr transform_fn | transform {}
constexpr trim_fn | trim {}
constexpr unbounded_fn | unbounded {}
constexpr view_closure< unique_fn > | unique {}
constexpr view_closure< values_fn > | values {}
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

## cartesian_produce_view_can_bidi

template<typename IsConst , typename... Views>

concept ranges::cartesian_produce_view_can_bidi

`#include <range/v3/view/cartesian_product.hpp>`

Initial value:
=
cartesian_produce_view_can_random<IsConst, Views...> ||
ranges::cartesian_produce_view_can_bidi_ < IsConst, Views... >

## cartesian_produce_view_can_const

template<typename... Views>

concept ranges::cartesian_produce_view_can_const

`#include <range/v3/view/cartesian_product.hpp>`

Initial value:
=
and_v<range<Views const>...>

## cartesian_produce_view_can_distance

template<typename IsConst , typename... Views>

concept ranges::cartesian_produce_view_can_distance

`#include <range/v3/view/cartesian_product.hpp>`

Initial value:
=
cartesian_produce_view_can_size<IsConst, Views...> &&
ranges::cartesian_produce_view_can_distance_ < IsConst, Views... >

## cartesian_produce_view_can_random

template<typename IsConst , typename... Views>

concept ranges::cartesian_produce_view_can_random

`#include <range/v3/view/cartesian_product.hpp>`

Initial value:
=
cartesian_produce_view_can_distance<IsConst, Views...> &&
ranges::cartesian_produce_view_can_random_ < IsConst, Views... >

## cartesian_produce_view_can_size

template<typename IsConst , typename... Views>

concept ranges::cartesian_produce_view_can_size

`#include <range/v3/view/cartesian_product.hpp>`

Initial value:
=
and_v<sized_range<meta::const_if<IsConst, Views>>...> &&
ranges::cartesian_produce_view_can_size_ < IsConst, Views... >

## invocable_view_closure

template<typename ViewFn , typename Rng >

concept ranges::invocable_view_closure

`#include <range/v3/view/view.hpp>`

Initial value:
=
invocable<ViewFn, Rng> &&
ranges::invocable_view_closure_ < ViewFn, Rng >

## make_view_closure

constexpr make_view_closure_fn ranges::make_view_closure {}

`#include <range/v3/view/view.hpp>`

See also
  make_view_closure_fn

## simple_view_

template<typename Rng >

concept ranges::simple_view_

`#include <range/v3/view/view.hpp>`

Initial value:
=
view_<Rng> &&
range<Rng const> &&
ranges::simple_view_frag_ < Rng >