I noticed today that std::vector::at() is significantly slower than accessing values with square brackets []. According to the doc .at() i
std::vector::at()
[]
.at()
at() returns the element with index i and throws range error exception if index i is out of range . so i would suggest using at() rather than [] since it yields undefined behavior if out of range. if you want safety in your proggy use at() :).
at()
i