basic_string::at

const_reference at(size_type pos) const;
reference at(size_type pos);

Each member function returns a reference to the element of the controlled sequence at position pos, or reports an out-of-range error.