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

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

✨ NAME ✨

std::ranges::filter_view::sentinel β€” std::ranges::filter_view::sentinel

okay so bestie, welcome to the std::ranges...w::sentinel(3) page from the C++ Standard Libary manual. Today's main character is std::ranges::filter_view::sentinel, and she is lowkey an exposition-only icon πŸ’…

πŸ¦‹ Synopsis πŸ¦‹

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

the vibe: this is the return type of filter_view::end when the underlying view type (V) does not model common_range. no cap, that's the condition 🫢

πŸŽ€ Member functions πŸŽ€

  • constructor β€” constructs a sentinel. (C++20) (public member function)
  • base β€” returns the underlying sentinel. (C++20) (public member function)

🌸 std::ranges::filter_view::sentinel::sentinel 🌸

/*sentinel*/() = default;                               (1) (since C++20)
constexpr explicit /*sentinel*/( filter_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_).

πŸ’– std::ranges::filter_view::sentinel::base πŸ’–

constexpr ranges::sentinel_t<V> base() const;  (since C++20)

Equivalent to return end_;. literally that's the whole function, and she ate πŸ“

🌈 Non-member functions 🌈

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

✨ operator==(std::ranges::filter_view::iterator, std::ranges::filter_view::sentinel) ✨

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

Equivalent to return x.current_ == y.end_;, where current_ is the underlying iterator wrapped in filter_view::iterator.

The != operator is synthesized from operator==. freebie behavior, iykyk 😌

heads up: this function is not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when std::ranges::filter_view::sentinel is an associated class of the arguments. so don't just go searching for her anywhere, bestie πŸ‘€

and that's the page, babes πŸ’… source: cppreference.com, version/date: 2024.06.10 β€” cute little sign-off from the std::ranges...w::sentinel(3) manual, periodt πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from