Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | ranges‎ | elements view‎ | iterator
 
 
Ranges library
Range access
Range conversions
(C++23)
Range primitives



Dangling iterator handling
Range concepts
Views

Factories




Adaptors
Range adaptor objects
Range adaptor closure objects
Helper items
 
 
constexpr decltype(auto) operator[]( difference_type n ) const
  requires ranges::random_access_range<Base>;
(since C++20)

Returns the element at specified relative location.

Effectively returns /*get-element*/(this->base() + n), where for an expression e, /*get-element*/(e) is

[edit] Parameters

n - position relative to current location.

[edit] Return value

the element at displacement n relative to the current location

[edit] Example