std::ranges...::operator[](3)

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

std::ranges...::operator[](3) πŸ’…

okay so bestie, welcome to the C++ Standard Libary manual page for std::ranges::transform_view::iterator::operator[]. yes it's a mouthful, no we're not scared of it. 🫢

🌸 NAME 🌸

std::ranges::transform_view::iterator::operator[] - std::ranges::transform_view::iterator::operator[]

(it's literally giving the same name twice on the page, that's just the layout. slay.)

✨ Synopsis ✨

          constexpr decltype(auto) operator[]( difference_type n ) const
       (since C++20)
            requires ranges::random_access_range<Base>;

so this operator[] is here since C++20, and it's gated by requires ranges::random_access_range<Base>; β€” that's the requirement, not a vibe I made up. πŸ’…

Returns the element at specified relative location, after transformation. main character behavior honestly. ✨

Effectively returns std::invoke(*parent_->fun_, current_[n]), where *parent_->fun_ is the transformation function stored in the parent transform_view, and current_ is the underlying iterator into V.

πŸ¦‹ Parameters πŸ¦‹

  • n β€” position relative to current location. that's the whole parameter, bestie.

πŸ’œ Return value πŸ’œ

the transformed element. periodt. πŸ’–

πŸ“ Example πŸ“

This section is incomplete Reason: no example

not me showing up to the example section and it's just a no-example note 😭 iconic honestly.

πŸ’… Category πŸ’…

  • Todo no example

xoxo, from http://cppreference.com πŸ’– dated 2024.06.10 🌸

πŸ“¦ where this page comes from