Namespaces
Variants
Views
Actions

std::span::operator[]

From cppreference.com
< cpp‎ | container‎ | span
constexpr reference operator[](index_type idx) const;

Returns a reference to the idx-th element of the sequence. The behavior is undefined if idx is out of range (i.e., if it is greater than or equal to size()).

Contents

[edit] Parameters

idx - the index of the element to access

[edit] Return value

A reference to the idx-th element of the sequence, i.e., data()[idx]

[edit] Exceptions

(none)

[edit] See also

returns a pointer to the beginning of the sequence of elements
(public member function) [edit]
returns the number of elements in the sequence
(public member function) [edit]