libstdc++: std::ranges::subrange< _It, _Sent, _Kind > Class Template Reference

libstdc++

std::ranges::subrange< _It, _Sent, _Kind > Class Template Reference

`#include <ranges_util.h>`

Inheritance diagram for std::ranges::subrange< _It, _Sent, _Kind >:
[legend]

## Public Member Functions
constexpr | subrange (__detail::__convertible_to_non_slicing< _It > auto __i, _Sent __s) noexcept(is_nothrow_constructible_v< _It, decltype(__i)> &&is_nothrow_constructible_v< _Sent, _Sent & >)
constexpr | subrange (__detail::__convertible_to_non_slicing< _It > auto __i, _Sent __s, __size_type __n) noexcept(is_nothrow_constructible_v< _It, decltype(__i)> &&is_nothrow_constructible_v< _Sent, _Sent & >)
template<__detail::__different_from< subrange > _Rng> requires _S_store_size
constexpr | subrange (_Rng &&__r) noexcept(noexcept(subrange(__r, ranges::size(__r)))) &&sized_range< _Rng >
template<__detail::__different_from< subrange > _Rng> requires (!_S_store_size)
constexpr | subrange (_Rng &&__r) noexcept(noexcept(subrange(ranges::begin(__r), ranges::end(__r))))
template<borrowed_range _Rng> requires (_Kind == subrange_kind::sized)
constexpr | subrange (_Rng &&__r, __size_type __n) noexcept(noexcept(subrange(ranges::begin(__r), ranges::end(__r), __n)))
constexpr subrange & | advance (iter_difference_t< _It > __n)
constexpr decltype(auto) | back ()
constexpr decltype(auto) | back () const
constexpr _It | begin ()
constexpr _It | begin () const
constexpr auto | cbegin ()
constexpr auto | cbegin () const
constexpr auto | cend ()
constexpr auto | cend () const
constexpr auto | data () const noexcept(noexcept(ranges::begin(_M_derived())))
constexpr auto | data () noexcept(noexcept(ranges::begin(_M_derived())))
constexpr bool | empty () const
constexpr bool | empty () noexcept(noexcept(_S_empty(_M_derived())))
constexpr _Sent | end () const
constexpr decltype(auto) | front ()
constexpr decltype(auto) | front () const
constexpr subrange | next (iter_difference_t< _It > __n=1) &&
constexpr subrange | next (iter_difference_t< _It > __n=1) const &
template<__detail::__different_from< subrange > _PairLike>
constexpr | operator _PairLike () const
constexpr | operator bool () const noexcept(noexcept(ranges::empty(_M_derived())))
constexpr | operator bool () noexcept(noexcept(ranges::empty(_M_derived())))
template<random_access_range _Range = _Derived>
constexpr decltype(auto) | operator[] (range_difference_t< _Range > __n)
template<random_access_range _Range = const _Derived>
constexpr decltype(auto) | operator[] (range_difference_t< _Range > __n) const
constexpr subrange | prev (iter_difference_t< _It > __n=1) const
constexpr __size_type | size () const
constexpr auto | size () noexcept(noexcept(_S_size(_M_derived())))

## Friends
struct | views::_Drop

## Detailed Description

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>
requires (_Kind == subrange_kind::sized || !sized_sentinel_for<_Sent, _It>)
class std::ranges::subrange< _It, _Sent, _Kind >

The ranges::subrange class template.

Definition at line 269 of file ranges_util.h.

## Constructor & Destructor Documentation

## ◆ subrange() [1/5]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

std::ranges::subrange< _It, _Sent, _Kind >::subrange | ( | __detail::__convertible_to_non_slicing< _It > auto | __i,
|  | _Sent | __s )
| inlineconstexprnoexcept

Definition at line 304 of file ranges_util.h.

## ◆ subrange() [2/5]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

std::ranges::subrange< _It, _Sent, _Kind >::subrange | ( | __detail::__convertible_to_non_slicing< _It > auto | __i,
|  | _Sent | __s,
|  | __size_type | __n )
| inlineconstexprnoexcept

Definition at line 312 of file ranges_util.h.

## ◆ subrange() [3/5]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>
template<__detail::__different_from< subrange > _Rng>
requires _S_store_size

std::ranges::subrange< _It, _Sent, _Kind >::subrange | ( | _Rng && | __r | ) | &&
| inlineconstexprnoexcept

Definition at line 325 of file ranges_util.h.

## ◆ subrange() [4/5]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>
template<__detail::__different_from< subrange > _Rng>
requires (!_S_store_size)

std::ranges::subrange< _It, _Sent, _Kind >::subrange | ( | _Rng && | __r | ) |
| inlineconstexprnoexcept

Definition at line 336 of file ranges_util.h.

## ◆ subrange() [5/5]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>
template<borrowed_range _Rng>
requires (_Kind == subrange_kind::sized)

std::ranges::subrange< _It, _Sent, _Kind >::subrange | ( | _Rng && | __r,
|  | __size_type | __n )
| inlineconstexprnoexcept

Definition at line 346 of file ranges_util.h.

## Member Function Documentation

## ◆ advance()

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

subrange & std::ranges::subrange< _It, _Sent, _Kind >::advance | ( | iter_difference_t< _It > | __n | ) |
| inlineconstexpr

Definition at line 406 of file ranges_util.h.

## ◆ back() [1/2]

template<typename _Derived>

decltype(auto) std::ranges::view_interface< _Derived >::back | ( |  | ) |
| inlineconstexprinherited

Definition at line 176 of file ranges_util.h.

## ◆ back() [2/2]

template<typename _Derived>

decltype(auto) std::ranges::view_interface< _Derived >::back | ( |  | ) | const
| inlineconstexprinherited

Definition at line 184 of file ranges_util.h.

## ◆ begin() [1/2]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

_It std::ranges::subrange< _It, _Sent, _Kind >::begin | ( |  | ) |
| inlinenodiscardconstexpr

Definition at line 364 of file ranges_util.h.

## ◆ begin() [2/2]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

_It std::ranges::subrange< _It, _Sent, _Kind >::begin | ( |  | ) | const
| inlineconstexpr

Definition at line 360 of file ranges_util.h.

## ◆ cbegin() [1/2]

template<typename _Derived>

auto std::ranges::view_interface< _Derived >::cbegin | ( |  | ) |
| inlineconstexprinherited

Definition at line 204 of file ranges_util.h.

## ◆ cbegin() [2/2]

template<typename _Derived>

auto std::ranges::view_interface< _Derived >::cbegin | ( |  | ) | const
| inlineconstexprinherited

Definition at line 208 of file ranges_util.h.

## ◆ cend() [1/2]

template<typename _Derived>

auto std::ranges::view_interface< _Derived >::cend | ( |  | ) |
| inlineconstexprinherited

Definition at line 212 of file ranges_util.h.

## ◆ cend() [2/2]

template<typename _Derived>

auto std::ranges::view_interface< _Derived >::cend | ( |  | ) | const
| inlineconstexprinherited

Definition at line 216 of file ranges_util.h.

## ◆ data() [1/2]

template<typename _Derived>

auto std::ranges::view_interface< _Derived >::data | ( |  | ) | const
| inlineconstexprnoexceptinherited

Definition at line 143 of file ranges_util.h.

## ◆ data() [2/2]

template<typename _Derived>

auto std::ranges::view_interface< _Derived >::data | ( |  | ) |
| inlineconstexprnoexceptinherited

Definition at line 138 of file ranges_util.h.

## ◆ empty() [1/2]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

bool std::ranges::subrange< _It, _Sent, _Kind >::empty | ( |  | ) | const
| inlineconstexpr

Definition at line 369 of file ranges_util.h.

## ◆ empty() [2/2]

template<typename _Derived>

bool std::ranges::view_interface< _Derived >::empty | ( |  | ) |
| inlineconstexprnoexceptinherited

Definition at line 104 of file ranges_util.h.

## ◆ end()

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

_Sent std::ranges::subrange< _It, _Sent, _Kind >::end | ( |  | ) | const
| inlineconstexpr

Definition at line 367 of file ranges_util.h.

## ◆ front() [1/2]

template<typename _Derived>

decltype(auto) std::ranges::view_interface< _Derived >::front | ( |  | ) |
| inlineconstexprinherited

Definition at line 162 of file ranges_util.h.

## ◆ front() [2/2]

template<typename _Derived>

decltype(auto) std::ranges::view_interface< _Derived >::front | ( |  | ) | const
| inlineconstexprinherited

Definition at line 169 of file ranges_util.h.

## ◆ next() [1/2]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

subrange std::ranges::subrange< _It, _Sent, _Kind >::next | ( | iter_difference_t< _It > | __n = 1 | ) | &&
| inlinenodiscardconstexpr

Definition at line 390 of file ranges_util.h.

## ◆ next() [2/2]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

subrange std::ranges::subrange< _It, _Sent, _Kind >::next | ( | iter_difference_t< _It > | __n = 1 | ) | const &
| inlinenodiscardconstexpr

Definition at line 381 of file ranges_util.h.

## ◆ operator _PairLike()

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>
template<__detail::__different_from< subrange > _PairLike>

std::ranges::subrange< _It, _Sent, _Kind >::operator _PairLike | ( |  | ) | const
| inlineconstexpr

Definition at line 356 of file ranges_util.h.

## ◆ operator bool() [1/2]

template<typename _Derived>

std::ranges::view_interface< _Derived >::operator bool | ( |  | ) | const
| inlineexplicitconstexprnoexceptinherited

Definition at line 133 of file ranges_util.h.

## ◆ operator bool() [2/2]

template<typename _Derived>

std::ranges::view_interface< _Derived >::operator bool | ( |  | ) |
| inlineexplicitconstexprnoexceptinherited

Definition at line 128 of file ranges_util.h.

## ◆ operator[]() [1/2]

template<typename _Derived>
template<random_access_range _Range = _Derived>

decltype(auto) std::ranges::view_interface< _Derived >::operator[] | ( | range_difference_t< _Range > | __n | ) |
| inlineconstexprinherited

Definition at line 194 of file ranges_util.h.

## ◆ operator[]() [2/2]

template<typename _Derived>
template<random_access_range _Range = const _Derived>

decltype(auto) std::ranges::view_interface< _Derived >::operator[] | ( | range_difference_t< _Range > | __n | ) | const
| inlineconstexprinherited

Definition at line 199 of file ranges_util.h.

## ◆ prev()

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

subrange std::ranges::subrange< _It, _Sent, _Kind >::prev | ( | iter_difference_t< _It > | __n = 1 | ) | const
| inlinenodiscardconstexpr

Definition at line 397 of file ranges_util.h.

## ◆ size() [1/2]

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

__size_type std::ranges::subrange< _It, _Sent, _Kind >::size | ( |  | ) | const
| inlineconstexpr

Definition at line 372 of file ranges_util.h.

## ◆ size() [2/2]

template<typename _Derived>

auto std::ranges::view_interface< _Derived >::size | ( |  | ) |
| inlineconstexprnoexceptinherited

Definition at line 149 of file ranges_util.h.

## Friends And Related Symbol Documentation

## ◆ views::_Drop

template<input_or_output_iterator _It, sentinel_for< _It > _Sent = _It, subrange_kind _Kind = sized_sentinel_for<_Sent, _It> ? subrange_kind::sized : subrange_kind::unsized>

friend struct views::_Drop
| friend

Definition at line 275 of file ranges_util.h.

The documentation for this class was generated from the following file:

- ranges_util.h