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

> C++ Atlas: `cppatlas.com/w/cpp/ranges/transform_view/iterator/operator_at` | Source: https://en.cppreference.com/w/cpp/ranges/transform_view/iterator/operator_at | Domain: Ranges | Standards: C++20

Returns the element at specified relative location, after transformation.

## Official Specification Summary (cppreference)

```cpp
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`.

### Parameters

- `n` - position relative to current location.

### Return value

the transformed element

### Example

> Note: This section is incomplete Reason: no example

---
Attribution: content from https://en.cppreference.com/w/cpp/ranges/transform_view/iterator/operator_at (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.