# std::basic_const_iterator<Iter>::operator[]

> C++ Atlas: `cppatlas.com/w/cpp/iterator/basic_const_iterator/operator_at` | Source: https://en.cppreference.com/w/cpp/iterator/basic_const_iterator/operator_at | Domain: Iterator | Standards: C++23

Returns a reference to the element at specified relative location.

## Official Specification Summary (cppreference)

```cpp
constexpr std::iter_const_reference_t<Iter> operator[]( difference_type n ) const
    requires std::random_access_iterator<Iterator>; // (since C++23)
```

Returns a reference to the element at specified relative location.

### Parameters

- `n` - position relative to current location

### Return value

A reference-to-const to the element at relative location, that is, `static_cast<std::iter_const_reference_t<Iter>>(base()[n])`.

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`operator*`](https://en.cppreference.com/w/cpp/iterator/basic_const_iterator/operator*), [`operator->`](https://en.cppreference.com/w/cpp/iterator/basic_const_iterator/operator*): accesses the pointed-to element (public member function)

---
Attribution: content from https://en.cppreference.com/w/cpp/iterator/basic_const_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.