Check the return value for negative index, to prevent crash.
Also, use at(index) when unsure about boundary condition. That makes it easier to detect where illegal memory access is being done.
Showing
Please
register
or
sign in
to comment