Share via


basic_string::operator[]

basic_string::operator[]

const_reference operator[](size_type pos) const;
reference operator[](size_type pos);

Each member function returns a reference to the element of the controlled sequence at position pos. If that position is invalid, the behavior is undefined.