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

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

πŸŽ€ NAME πŸŽ€

Bestie, welcome to the std::ranges::join_with_view::sentinel::sentinel page from the C++ Standard Libary manual, section (3) πŸ’…βœ¨. Yes, we’re talking about the sentinel constructor, and it’s giving niche but iconic energy.

✨ Synopsis ✨

          /*sentinel*/() = default;
       (1) (since C++23)
          constexpr /*sentinel*/( /*sentinel*/<!Const> i )

            requires Const &&
       (2) (since C++23)

              std::convertible_to<ranges::sentinel_t<V>,
          ranges::sentinel_t<const V>>;

Okay so this thing constructs a sentinel 🫢. Here’s the breakdown:

  • /*sentinel*/() = default; β€” (1) (since C++23) β€” Default constructor. Value-initializes the underlying sentinel. Slay.
  • constexpr /*sentinel*/( /*sentinel*/<!Const> i ) β€” (2) (since C++23) β€” Conversion from /*sentinel*/<false> to /*sentinel*/<true>. Move constructs the underlying sentinel with the corresponding member of i. The requires clause is Const && std::convertible_to<ranges::sentinel_t<V>, ranges::sentinel_t<const V>>; β€” yes, that’s the whole vibe check πŸ’–.

Also lowkey: this type has a private constructor used by join_with_view::end. This constructor is not accessible to users πŸ”’, so no touching, bestie.

🌸 Parameters 🌸

  • i β€” a /*sentinel*/<false> πŸŽ€

πŸ¦‹ Example πŸ¦‹

This section is incomplete Reason: no example 😭

πŸ’œ Category πŸ’œ

Category:

  • Todo no example

Made with love from the C++ Standard Libary manual, source/version http://cppreference.com, dated 2024.06.10 πŸ«ΆπŸ’– byeeee!

πŸ“¦ where this page comes from