std::ranges...r::operator*(3)
π NAME π
okay so we're in the C++ Standard Libary manual (yes, that's how it's spelled up top π
), on the page for std::ranges::adjacent_view::iterator::operator* β footer name std::ranges...r::operator*(3), if you're keeping track.
And the NAME section literally says std::ranges::adjacent_view::iterator::operator* again. Double name, double slay β¨
π Synopsis π
The signature is a whole mood:
constexpr auto operator*() const;
(since C++23) β this one's tagged as C++23, bestie. Not before, no cap.
πΈ Parameters πΈ
(none) β zero, nada, nothing to pass in π«Ά
π¦ Return value π¦
The current element, which is a std::tuple of references to underlying elements. So it's giving tuple-of-refs energy, lowkey iconic.
β Notes β
operator-> is not provided. That's the whole note. No arrow, no cap, it's just not provided π
π₯ Example π₯
Run this code, bestie:
// Run this code
#include <ranges>
#include <tuple>
int main()
{
constexpr static auto v = {0, 1, 2, 3, 4, 5};
// ββββ¬βββ
// βββββββββββββββββββ
constexpr auto view {v | std::views::adjacent<3>}; // β
constexpr auto iter {view.begin() + 2}; // β
// ββββββββββββββββββββββ¬βββββββββββββββββ
// β ββββ΄βββ
static_assert(*iter == std::tuple{2, 3, 4});
}
π See also π
operator[]β accesses an element by index;(C++23)(public member function)
This page is from http://cppreference.com, with version/date 2024.06.10, and the full footer name is std::ranges...r::operator*(3). Bye bestie, go dereference something cute πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms