Spec-Zone.ru › C++

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

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

See also

operator*operator->
accesses the pointed-to element
(public member function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/iterator/basic_const_iterator/operator_at

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API