Range-v3
Range algorithms, views, and actions for the Standard Library
ranges::v3::view_interface< Derived, Cardinality > Struct Template Reference
+ Inheritance diagram for ranges::v3::view_interface< Derived, Cardinality >:

Friends

template<typename D = Derived, requires = (Same<D, Derived>() && InputRange<D const>())>
std::ostream & operator<< (std::ostream &sout, Derived const &rng)
 
template<typename D = Derived, requires = (Same<D, Derived>() && !Range<D const>() && InputRange<D>())>
std::ostream & operator<< (std::ostream &sout, Derived &rng)
 
template<typename D = Derived, requires = (Same<D, Derived>() && !Range<D const>() && InputRange<D>())>
std::ostream & operator<< (std::ostream &sout, Derived &&rng)
 

Public Member Functions

template<typename D = Derived, requires = (Same<D, Derived>() && RandomAccessRange<D>() && SizedRange<D>())>
auto at (range_difference_type_t< D > n) -> decltype(std::declval< D &>().begin()[n])
 Returns a reference to the element at specified location pos, with bounds checking.
 
template<typename D = Derived, requires = (Same<D, Derived>() && RandomAccessRange<D const>() && SizedRange<D const>())>
auto at (range_difference_type_t< D > n) const -> decltype(std::declval< D const &>().begin()[n])
 
template<typename D = Derived, requires = (Same<D, Derived>() && BoundedRange<D>() && BidirectionalRange<D>())>
range_reference_t< D > back ()
 Access the last element in a range:
 
template<typename D = Derived, requires = (Same<D, Derived>() && BoundedRange<D const>() && BidirectionalRange<D const>())>
range_reference_t< D const > back () const
 
constexpr bool empty () const noexcept
 
template<typename D = Derived, requires = (Same<D, Derived>() && Cardinality < 0 && ForwardRange<D const>())>
constexpr bool empty () const noexcept(noexcept(bool(ranges::begin(std::declval< D const &>())==ranges::end(std::declval< D const &>()))))
 
template<typename D = Derived, requires = (Same<D, Derived>() && ForwardRange<D>())>
range_reference_t< D > front ()
 Access the first element in a range:
 
template<typename D = Derived, requires = (Same<D, Derived>() && ForwardRange<D const>())>
range_reference_t< D const > front () const
 
template<typename D = Derived, requires = (Same<D, Derived>()), typename = decltype(ranges::empty(std::declval<D const &>()))>
constexpr operator bool () const noexcept(noexcept(ranges::empty(std::declval< D const &>())))
 
template<typename Container , typename D = Derived, typename = typename Container::allocator_type, requires = (detail::ConvertibleToContainer<D, Container>())>
 operator Container ()
 Implicit conversion to something that looks like a container.
 
template<typename Container , typename D = Derived, typename = typename Container::allocator_type, requires = (detail::ConvertibleToContainer<D const, Container>())>
 operator Container () const
 
template<typename D = Derived, requires = (Same<D, Derived>())>
constexpr auto operator! () const noexcept(noexcept(decltype(ranges::empty(std::declval< D const &>()))(ranges::empty(std::declval< D const &>())))) -> decltype(ranges::empty(std::declval< D const &>()))
 
view_interfaceoperator= (view_interface &&)=default
 
view_interfaceoperator= (view_interface const &)=default
 
template<typename D = Derived, requires = (Same<D, Derived>() && RandomAccessRange<D>())>
auto operator[] (range_difference_type_t< D > n) -> decltype(std::declval< D &>().begin()[n])
 Simple indexing:
 
template<typename D = Derived, requires = (Same<D, Derived>() && RandomAccessRange<D const>())>
auto operator[] (range_difference_type_t< D > n) const -> decltype(std::declval< D const &>().begin()[n])
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< range_difference_type_t< D >> offs) &-> decltype(std::declval< Slice >()(std::declval< D &>(), offs.from, offs.to))
 Python-ic slicing:
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< range_difference_type_t< D >> offs) const &-> decltype(std::declval< Slice >()(std::declval< D const &>(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< range_difference_type_t< D >> offs) &&-> decltype(std::declval< Slice >()(std::declval< D >(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< range_difference_type_t< D >, detail::from_end_< range_difference_type_t< D >>> offs) &-> decltype(std::declval< Slice >()(std::declval< D &>(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< range_difference_type_t< D >, detail::from_end_< range_difference_type_t< D >>> offs) const &-> decltype(std::declval< Slice >()(std::declval< D const &>(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< range_difference_type_t< D >, detail::from_end_< range_difference_type_t< D >>> offs) &&-> decltype(std::declval< Slice >()(std::declval< D >(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, detail::from_end_< range_difference_type_t< D >>> offs) &-> decltype(std::declval< Slice >()(std::declval< D &>(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, detail::from_end_< range_difference_type_t< D >>> offs) const &-> decltype(std::declval< Slice >()(std::declval< D const &>(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, detail::from_end_< range_difference_type_t< D >>> offs) &&-> decltype(std::declval< Slice >()(std::declval< D >(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< range_difference_type_t< D >, end_fn > offs) &-> decltype(std::declval< Slice >()(std::declval< D &>(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< range_difference_type_t< D >, end_fn > offs) const &-> decltype(std::declval< Slice >()(std::declval< D const &>(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< range_difference_type_t< D >, end_fn > offs) &&-> decltype(std::declval< Slice >()(std::declval< D >(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, end_fn > offs) &-> decltype(std::declval< Slice >()(std::declval< D &>(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, end_fn > offs) const &-> decltype(std::declval< Slice >()(std::declval< D const &>(), offs.from, offs.to))
 
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto operator[] (detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, end_fn > offs) &&-> decltype(std::declval< Slice >()(std::declval< D >(), offs.from, offs.to))
 
template<typename D = Derived, requires = (Same<D, Derived>() && Cardinality >= 0)>
constexpr range_size_type_t< D > size () const noexcept
 Access the size of the range, if it can be determined:
 
template<typename D = Derived, requires = (Same<D, Derived>() && Cardinality < 0 && SizedSentinel<sentinel_t<D const>, iterator_t<D const>>() && ForwardRange<D const>())>
constexpr range_size_type_t< D > size () const
 
 view_interface (view_interface &&)=default
 
 view_interface (view_interface const &)=default
 

Protected Member Functions

Derived & derived () noexcept
 
constexpr Derived const & derived () const noexcept
 

Methods

◆ operator<< [1/2]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, requires = (Same<D, Derived>() && !Range<D const>() && InputRange<D>())>
std::ostream& operator<< ( std::ostream &  sout,
Derived &  rng 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator<< [2/2]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, requires = (Same<D, Derived>() && !Range<D const>() && InputRange<D>())>
std::ostream& operator<< ( std::ostream &  sout,
Derived &&  rng 
)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Function Documentation

◆ at()

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, requires = (Same<D, Derived>() && RandomAccessRange<D const>() && SizedRange<D const>())>
auto ranges::v3::view_interface< Derived, Cardinality >::at ( range_difference_type_t< D >  n) const -> decltype(std::declval<D const &>().begin()[n])

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ back()

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, requires = (Same<D, Derived>() && BoundedRange<D const>() && BidirectionalRange<D const>())>
range_reference_t<D const> ranges::v3::view_interface< Derived, Cardinality >::back ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ derived()

template<typename Derived, cardinality Cardinality>
constexpr Derived const& ranges::v3::view_interface< Derived, Cardinality >::derived ( ) const
protectednoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ empty()

template<typename Derived, cardinality Cardinality>
constexpr bool ranges::v3::view_interface< Derived, Cardinality >::empty ( ) const
noexcept
Precondition
Cardinality >= 0

Referenced by ranges::v3::intersperse_view< Rng >::cursor_adaptor::advance().

◆ front()

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, requires = (Same<D, Derived>() && ForwardRange<D const>())>
range_reference_t<D const> ranges::v3::view_interface< Derived, Cardinality >::front ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator Container()

template<typename Derived, cardinality Cardinality>
template<typename Container , typename D = Derived, typename = typename Container::allocator_type, requires = (detail::ConvertibleToContainer<D const, Container>())>
ranges::v3::view_interface< Derived, Cardinality >::operator Container ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [1/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, requires = (Same<D, Derived>() && RandomAccessRange<D const>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( range_difference_type_t< D >  n) const -> decltype(std::declval<D const &>().begin()[n])

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [2/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< range_difference_type_t< D >>  offs) const & -> decltype(std::declval<Slice>()(std::declval<D const &>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [3/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< range_difference_type_t< D >>  offs) && -> decltype(std::declval<Slice>()(std::declval<D>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [4/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< range_difference_type_t< D >, detail::from_end_< range_difference_type_t< D >>>  offs) & -> decltype(std::declval<Slice>()(std::declval<D &>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [5/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< range_difference_type_t< D >, detail::from_end_< range_difference_type_t< D >>>  offs) const & -> decltype(std::declval<Slice>()(std::declval<D const &>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [6/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< range_difference_type_t< D >, detail::from_end_< range_difference_type_t< D >>>  offs) && -> decltype(std::declval<Slice>()(std::declval<D>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [7/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, detail::from_end_< range_difference_type_t< D >>>  offs) & -> decltype(std::declval<Slice>()(std::declval<D &>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [8/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, detail::from_end_< range_difference_type_t< D >>>  offs) const & -> decltype(std::declval<Slice>()(std::declval<D const &>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [9/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, detail::from_end_< range_difference_type_t< D >>>  offs) && -> decltype(std::declval<Slice>()(std::declval<D>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [10/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< range_difference_type_t< D >, end_fn >  offs) & -> decltype(std::declval<Slice>()(std::declval<D &>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [11/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< range_difference_type_t< D >, end_fn >  offs) const & -> decltype(std::declval<Slice>()(std::declval<D const &>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [12/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< range_difference_type_t< D >, end_fn >  offs) && -> decltype(std::declval<Slice>()(std::declval<D>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [13/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, end_fn >  offs) & -> decltype(std::declval<Slice>()(std::declval<D &>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [14/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, end_fn >  offs) const & -> decltype(std::declval<Slice>()(std::declval<D const &>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator[]() [15/15]

template<typename Derived, cardinality Cardinality>
template<typename D = Derived, typename Slice = view::slice_fn, requires = (Same<D, Derived>())>
auto ranges::v3::view_interface< Derived, Cardinality >::operator[] ( detail::slice_bounds< detail::from_end_< range_difference_type_t< D >>, end_fn >  offs) && -> decltype(std::declval<Slice>()(std::declval<D>(), offs.from, offs.to))

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.