Glossary: Data Structures and Algorithms in C++
at()
Also written: .at(), std::vector::at
A bounds-checked way to read an item that throws std::out_of_range if the index (vector) or key (map) is missing. Plain [] on a vector isn't checked.
Where the book teaches it
Related terms
Undefined behaviorExceptions (runtime_error, out_of_range, invalid_argument)