std::ranges...::operator[](3)
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
- 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