std::ranges...r::operator*(3)

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

πŸ¦‹ std::ranges...r::operator*(3) πŸ¦‹

Okay bestie, welcome to the C++ Standard Libary manual page for std::ranges...r::operator*(3). Manual name, folded in right here near the top: C++ Standard Libary (spelled exactly like that, iykyk). This page is all about the iterator dereference vibe, no cap. πŸ’…


πŸ’– NAME πŸ’–

std::ranges::adjacent_transform_view::iterator::operator* β€” std::ranges::adjacent_transform_view::iterator::operator*

Yes bestie, it really says the same iconic name twice. We keep every detail. 🫢


✨ Synopsis ✨

constexpr decltype(auto) operator*() const noexcept(/* see below */);

(since C++23)

So this is the synopsis, and it is giving conditionally noexcept main character energy. The noexcept(/* see below */) is literally telling you to look below, bestie. πŸ‘€


πŸŽ€ Parameters πŸŽ€

(none)

No parameters. Zero. None. The void is empty and honestly kind of peaceful. 🧚


🌸 Return value 🌸

It returns the current element in the adjacent_transform_view. That’s it. That’s the whole return value. Slay. ✨

Quick little vocab check before the next bit: let parent_ and inner_ be the data members of the iterator. Important names, keep them in your notes. πŸ“

It is equivalent to:

        return apply([&](const auto&... iters) -> decltype(auto)
                     {
                         return invoke(*parent_->fun_, *iters...);
                     },
                     inner_.current_);

That code block is verbatim, bestie. Do not β€œfix” the spacing. It ate. πŸ’…


πŸ’… Exceptions πŸ’…

Let Is be the pack 0, 1, ..., (N - 1).

The noexcept specification is:

          noexcept(std::invoke(*parent_->fun_,
       *std::get<Is>(inner_.current_)...))

Behold: the conditionally noexcept moment. πŸ”₯


πŸ“ Example πŸ“

This section is incomplete.

Reason: no example.

Bestie, there is literally no example here. The manual page said β€œno example” and we are respecting that. 😭


πŸ¦‹ See also πŸ¦‹

  • operator[] accesses an element by index (C++23) (public member function)

That’s the see-also link, fully preserved with its (C++23) and (public member function) badge. 🌈


⭐ Categories ⭐

  • conditionally noexcept
  • Todo no example

Both categories are here, untouched, living their best life. πŸŽ€


Source/version check, bestie: http://cppreference.com, date 2024.06.10, page std::ranges...r::operator*(3). That’s the whole vibe, periodt. Mwah πŸ’‹βœ¨πŸ«Ά

πŸ“¦ where this page comes from