STD::RANGES::SUBRANGE(3cxx)

okay bestie, welcome to the std::ranges::subrange< _It, _Sent, _Kind > manual page, section 3cxx β€” yes, the C++ ranges one. Template-heavy? Sadly yes. Slayable? Also yes πŸ’…βœ¨

πŸ’– NAME πŸ’–

std::ranges::subrange< _It, _Sent, _Kind > β€” the ranges::subrange class template. That's the whole name, no cap.

✨ SYNOPSIS ✨

Pop this include in your file like it's a friendship bracelet:

#include <ranges>

It inherits from std::ranges::view_interface< _Derived > β€” view-interface nepo baby energy, honestly 🫢.

🫢 Public Member Functions 🫢

Here's the full member-function lineup, exactly as printed. Some signatures have stray " marks from the Doxygen output; I'm keeping them character-for-character because we do not mess with code in this group chat πŸ’€.

       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 borrowed_range<_Rng> &&
           __detail::__convertible_to_non_slicing<iterator_t<_Rng>, _It> &&
           convertible_to<sentinel_t<_Rng>, _Sent>constexpr subrange (_Rng
           &&__r) noexcept(noexcept(subrange(__r, ranges::size(__r))))
           _S_store_size &&sized_range< _Rng >"
       template<__detail::__different_from< subrange > _Rng>
           requires borrowed_range<_Rng> &&
           __detail::__convertible_to_non_slicing<iterator_t<_Rng>, _It> &&
           convertible_to<sentinel_t<_Rng>, _Sent> (!_S_store_size)constexpr
           subrange (_Rng &&__r) noexcept(noexcept(subrange(ranges::begin(__r),
           ranges::end(__r))))"
       template<borrowed_range _Rng>
           requires __detail::__convertible_to_non_slicing<iterator_t<_Rng>,
           _It> && convertible_to<sentinel_t<_Rng>, _Sent> (_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 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>
           requires __detail::__pair_like_convertible_from<_PairLike, const
           _It&, const _Sent&>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 β€” that's the friend. Short, iconic, no notes 🫢

🌸 Detailed Description 🌸

The class template declaration in all its glory:

       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.

And the description is literally: The ranges::subrange class template. That's it. That's the summary. Main character minimalism, periodt πŸ’…

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code.


cute sign-off 🫢: this page is from libstdc++, tagged 3cxx, generated automatically by Doxygen from the source code. The footer doesn't actually give us a date, so no invented date here β€” just source/version vibes, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from