Namespaces
Variants
Actions

std::ranges::transform_view<V,F>::iterator<Const>::operator[]

From cppreference.com
 
C++
 
Ranges library
Range adaptors
 
std::ranges::transform_view
constexpr decltype(auto) operator[]( difference_type n ) const
  requires ranges::random_access_range<Base>;
(since C++20)

Returns the element at specified relative location, after transformation.

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.

[edit] Parameters

n - position relative to current location.

[edit] Return value

the transformed element

[edit] Example

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant