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

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 >
requires defer::not_same_as_< PairLike, subrange > &&detail::defer::pair_like_convertible_from_< PairLike, const I &, const S & > constexpr operator PairLike () const
 
constexpr auto prev (iter_difference_t< I > n=1) const -> subrange requires bidirectional_iterator< I >
 
constexpr auto size () const -> size_type requires(K==subrange_kind::sized)
 
template<typename I2 >
constexpr subrange (I2 &&i, S s) requires detail
 
template<typename I2 >
constexpr subrange (I2 &&i, S s, size_type n) requires detail
 
template<typename I2 >
constexpr subrange (I2 &&i, S s, size_type n) requires detail
 
template<typename R >
constexpr subrange (R &&r) requires defer
 
template<typename R >
constexpr subrange (R &&r) requires defer
 
template<typename R >
constexpr subrange (R &&r, size_type n) requires detail
 
- Public Member Functions inherited from ranges::view_interface< subrange< I, S, K >, same_as< S, unreachable_sentinel_t > ? infinite :K==subrange_kind::sized ? finite :unknown >
constexpr auto at (range_difference_t< D< True >> n) -> range_reference_t< D< True >> requires True &&random_access_range< D< True >> &&sized_range< D< True >>
 Returns a reference to the element at specified location pos, with bounds checking.
 
constexpr auto at (range_difference_t< D< True >> n) const -> range_reference_t< D< True > const > requires True &&random_access_range< D< True > const > &&sized_range< D< True > const >
 
constexpr auto back () -> range_reference_t< D< True >> requires True &&common_range< D< True >> &&bidirectional_range< D< True >>
 Access the last element in a range:
 
constexpr auto back () const -> range_reference_t< D< True > const > requires True &&common_range< D< True > const > &&bidirectional_range< D< True > const >
 
constexpr auto empty () const noexcept -> bool requires(detail::has_fixed_size_(Cardinality))
 
constexpr auto empty () noexcept(noexcept(bool(ranges::size(std::declval< D< True > & >())==0))) -> bool requires True &&(Cardinality< 0) &&(Cardinality !=infinite) &&(!forward_range< D< True >>)&&sized_range< D< True >>
 
constexpr auto empty () const noexcept(noexcept(bool(ranges::size(std::declval< D< True > const & >())==0))) -> bool requires True &&(Cardinality< 0) &&(Cardinality !=infinite) &&(!forward_range< D< True > const >)&&sized_range< D< True > const >
 
constexpr auto empty () noexcept(noexcept(bool(ranges::begin(std::declval< D< True > & >())==ranges::end(std::declval< D< True > & >())))) -> bool requires True &&(!detail::has_fixed_size_(Cardinality)) &&forward_range< D< True >>
 
constexpr auto empty () const noexcept(noexcept(bool(ranges::begin(std::declval< D< True > const & >())==ranges::end(std::declval< D< True > const & >())))) -> bool requires True &&(!detail::has_fixed_size_(Cardinality)) &&forward_range< D< True > const >
 
requires True && forward_range (input_range< D< True > & > &&sized_range< D< True > & >)) const expr auto operator[](detail
 
requires True && forward_range (input_range< D< True > const & > &&sized_range< D< True > const & >)) const expr auto operator[](detail
 
requires True && forward_range (input_range< D< True >> &&sized_range< D< True >>)) const expr auto operator[](detail
 
requires True && forward_range (input_range< D< True > & > &&sized_range< D< True > & >)) const expr auto operator[](detail
 
requires True && forward_range (input_range< D< True > const & > &&sized_range< D< True > const & >)) const expr auto operator[](detail
 
requires True && forward_range (input_range< D< True >> &&sized_range< D< True >>)) const expr auto operator[](detail
 
constexpr auto front () -> range_reference_t< D< True >> requires True &&forward_range< D< True >>
 Access the first element in a range:
 
constexpr auto front () const -> range_reference_t< D< True > const > requires True &&forward_range< D< True > const >
 
requires True &&detail::can_empty_< D< True > > constexpr operator bool () noexcept(noexcept(ranges::empty(std::declval< D< True > & >())))
 
requires True &&detail::can_empty_< D< True > const > constexpr operator bool () const noexcept(noexcept(ranges::empty(std::declval< D< True > const & >())))
 
view_interfaceoperator= (view_interface &&)=default
 
view_interfaceoperator= (view_interface const &)=default
 
constexpr auto operator[] (range_difference_t< D< True >> n) -> range_reference_t< D< True >> requires True &&random_access_range< D< True >>
 Simple indexing:
 
constexpr auto operator[] (range_difference_t< D< True >> n) const -> range_reference_t< D< True > const > requires True &&random_access_range< D< True > const >
 
requires True &&input_range< D< True > & > constexpr auto operator[] (detail::slice_bounds< range_difference_t< D< True >>> offs) &
 Python-ic slicing:
 
requires True &&input_range< D< True > const & > constexpr auto operator[] (detail::slice_bounds< range_difference_t< D< True >>> offs) const &
 
requires True &&input_range< D< True > > constexpr auto operator[] (detail::slice_bounds< range_difference_t< D< True >>> offs) &&
 
requires True &&input_range< D< True > & > &&sized_range< D< True > & > constexpr auto operator[] (detail::slice_bounds< range_difference_t< D< True >>, detail::from_end_of_t< D< True >>> offs) &
 
requires True &&input_range< D< True > const & > &&sized_range< D< True > const & > constexpr auto operator[] (detail::slice_bounds< range_difference_t< D< True >>, detail::from_end_of_t< D< True >>> offs) const &
 
requires True &&input_range< D< True > > &&sized_range< D< True > > constexpr auto operator[] (detail::slice_bounds< range_difference_t< D< True >>, detail::from_end_of_t< D< True >>> offs) &&
 
requires True &&input_range< D< True > & > constexpr auto operator[] (detail::slice_bounds< range_difference_t< D< True >>, end_fn > offs) &
 
requires True &&input_range< D< True > const & > constexpr auto operator[] (detail::slice_bounds< range_difference_t< D< True >>, end_fn > offs) const &
 
requires True &&input_range< D< True > > constexpr auto operator[] (detail::slice_bounds< range_difference_t< D< True >>, end_fn > offs) &&
 
constexpr auto size () -> detail::iter_size_t< iterator_t< D< True >>> requires True &&(Cardinality< 0) &&sized_sentinel_for< sentinel_t< D< True >>, iterator_t< D< True >>> &&forward_range< D< True >>
 If sized_sentinel_for<sentinel_t<Derived>, iterator_t<Derived>> is satisfied, and if Derived is a forward_range, then return end - begin cast to an unsigned integer.
 
constexpr auto size () const -> detail::iter_size_t< iterator_t< D< True >>> requires True &&(Cardinality< 0) &&sized_sentinel_for< sentinel_t< D< True > const >, iterator_t< D< True > const >> &&forward_range< D< True > const >
 
 view_interface (view_interface &&)=default
 
 view_interface (view_interface const &)=default
 

Additional Inherited Members

- Static Public Member Functions inherited from ranges::view_interface< subrange< I, S, K >, same_as< S, unreachable_sentinel_t > ? infinite :K==subrange_kind::sized ? finite :unknown >
static constexpr auto size () noexcept -> std::size_t requires True &&(Cardinality >=0)
 If the size of the range is known at compile-time and finite, return it.
 
- Protected Types inherited from ranges::view_interface< subrange< I, S, K >, same_as< S, unreachable_sentinel_t > ? infinite :K==subrange_kind::sized ? finite :unknown >
using D = meta::invoke< detail::dependent_< B >, subrange< I, S, K > >
 
- Protected Member Functions inherited from ranges::view_interface< subrange< I, S, K >, same_as< S, unreachable_sentinel_t > ? infinite :K==subrange_kind::sized ? finite :unknown >
constexpr subrange< I, S, K > & derived () noexcept
 
constexpr subrange< I, S, K > const & derived () const noexcept