Range-v3
Range algorithms, views, and actions for the Standard Library
ranges::subrange< I, S, K > Struct Template Reference

Public Types

using iterator = I
 
using sentinel = S
 
using size_type = detail::iter_size_t< I >
 

Public Member Functions

constexpr subrangeadvance (iter_difference_t< I > n)
 
constexpr I begin () const noexcept(std::is_nothrow_copy_constructible< I >::value)
 
constexpr bool empty () const
 
constexpr S end () const noexcept(std::is_nothrow_copy_constructible< S >::value)
 
constexpr subrange next (iter_difference_t< I > n=1) const
 
template<typename PairLike >
constexpr operator PairLike () const
 
constexpr auto prev (iter_difference_t< I > n=1) const -> subrange
 
constexpr auto size () const -> size_type
 
template<typename I2 >
constexpr subrange (I2 &&i, S s)
 
template<typename I2 >
constexpr subrange (I2 &&i, S s, size_type n)
 
template<typename I2 >
constexpr subrange (I2 &&i, S s, size_type n)
 
template<typename R >
constexpr subrange (R &&r)
 
template<typename R >
constexpr subrange (R &&r)
 
template<typename R >
constexpr subrange (R &&r, size_type n)
 

Member Function Documentation

◆ operator PairLike()

template<typename I , typename S , subrange_kind K>
template<typename PairLike >
constexpr ranges::subrange< I, S, K >::operator PairLike ( ) const
constexpr
Precondition
requires (!same_as<PairLike, subrange>) && detail::pair_like_convertible_from_<PairLike, I const &, S const &>

Constructor & Destructor Documentation

◆ subrange() [1/6]

template<typename I , typename S , subrange_kind K>
template<typename I2 >
constexpr ranges::subrange< I, S, K >::subrange ( I2 &&  i,
s 
)
constexpr
Precondition
requires detail::convertible_to_not_slicing_<I2, I> && (!detail::store_size_<K, S, I>()) //

◆ subrange() [2/6]

template<typename I , typename S , subrange_kind K>
template<typename I2 >
constexpr ranges::subrange< I, S, K >::subrange ( I2 &&  i,
s,
size_type  n 
)
constexpr
Precondition
requires detail::convertible_to_not_slicing_<I2, I> && (detail::store_size_<K, S, I>()) //

References ranges::aux::move.

◆ subrange() [3/6]

template<typename I , typename S , subrange_kind K>
template<typename I2 >
constexpr ranges::subrange< I, S, K >::subrange ( I2 &&  i,
s,
size_type  n 
)
constexpr
Precondition
requires detail::convertible_to_not_slicing_<I2, I> && sized_sentinel_for<S, I>

◆ subrange() [4/6]

template<typename I , typename S , subrange_kind K>
template<typename R >
constexpr ranges::subrange< I, S, K >::subrange ( R &&  r)
constexpr
Precondition
requires (!same_as<detail::decay_t<R>, subrange>) && detail::range_convertible_to_<R, I, S> && (!detail::store_size_<K, S, I>())

◆ subrange() [5/6]

template<typename I , typename S , subrange_kind K>
template<typename R >
constexpr ranges::subrange< I, S, K >::subrange ( R &&  r)
constexpr
Precondition
requires (!same_as<detail::decay_t<R>, subrange>) && detail::range_convertible_to_<R, I, S> && (detail::store_size_<K, S, I>()) && sized_range<R>

◆ subrange() [6/6]

template<typename I , typename S , subrange_kind K>
template<typename R >
constexpr ranges::subrange< I, S, K >::subrange ( R &&  r,
size_type  n 
)
constexpr
Precondition
requires (K == subrange_kind::sized) && detail::range_convertible_to_<R, I, S>

References ranges::begin, and ranges::end.