std::ranges...r::operator*(3)
π NAME π
okay so welcome to std::ranges...r::operator*(3) β the std::ranges::stride_view::iterator::operator* page from the C++ Standard Libary (their spelling, not mine π
), manual section 3.
std::ranges::stride_view::iterator::operator*std::ranges::stride_view::iterator::operator*
yep, the NAME section lists it twice, and we are not erasing one β both stay, bestie π
π¦ Synopsis π¦
constexpr decltype(auto) operator*() const; (since C++23)
Returns the elements into V the underlying iterator current_ points to.
Equivalent to: return *current_;.
π Parameters π
(none) β literally no parameters, not a single one π«Ά
π Return value π
The current element. That's it. That's the whole vibe β¨
πΈ Notes πΈ
operator-> is not provided.
no operator->, no cap. it's giving "you get the dereference and that's the whole story" π
π₯ Example π₯
// Run this code
#include <ranges>
int main()
{
constexpr static auto v = {'a', 'b', 'c', 'd', 'e'};
constexpr auto view{v | std::views::stride(2)};
constexpr auto iter{view.begin() + 1};
static_assert(*iter == 'c');
static_assert(*(view.begin() + 2) == 'e');
}
π See also π
operator[]β accesses an element by index, marked (C++23) and (public member function) π
xoxo, your local Unix bestie π§π β this page came from http://cppreference.com, dated 2024.06.10, and it's std::ranges...r::operator*(3). periodt β¨
π¦ 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