std::ranges...ew::sentinel(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’… NAME πŸ’…

std::ranges::split_view::sentinel β€” that’s the whole name, bestie πŸ’–. We’re in the C++ Standard Libary manual (yes, β€œLibary” is literally how the page header spells it, no cap 🫢), and this page is all about the sentinel type for std::ranges::split_view.

✨ Synopsis ✨

class /*sentinel*/;  (since C++20)
                             (exposition only*)

So this is the return type of split_view::end when the underlying view type (V) does not model common_range β€” like, it’s the special end-y type for that situation. πŸ’…

πŸŽ€ Member functions πŸŽ€

  • constructor β€” constructs a sentinel (C++20) (public member function) ✨

πŸ¦‹ std::ranges::split_view::sentinel::sentinel πŸ¦‹

/*sentinel*/() = default;                                      (1)

(since C++20)

constexpr explicit /*sentinel*/( ranges::split_view& parent ); (2)

(since C++20)

  1. Value-initializes end_ via its default member initializer (= ranges::sentinel_t<V>()).
  2. Initializes end_ with ranges::end(parent.base_).

🌈 Non-member functions 🌈

  • operator== β€” compares the underlying iterator and the underlying sentinel (C++20) (function) πŸ”₯

πŸ’– operator==(std::ranges::split_view::iterator, std::ranges::split_view::sentinel) πŸ’–

friend constexpr bool operator==( const /*iterator*/& x,
                                  const /*sentinel*/& y );

(since C++20)

Equivalent to return x.cur_ == y.end_ and !x.trailing_empty_; β€” that’s the whole vibe check. 🫢

The != operator is synthesized from operator==.

This function is not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when std::ranges::split_view::sentinel is an associated class of the arguments. πŸ‘‘


that’s the page, bestie πŸ’‹ source: http://cppreference.com Β· version/date: 2024.06.10 Β· manual page: std::ranges...ew::sentinel(3) πŸŽ€βœ¨

πŸ“¦ where this page comes from