3 ms·
> still-not-boundary-checked [...] std::vector Huh? vector::at() is boundary-checked. So you can choose whether you want to pay for boundary-checking or not.
by haberman 13y ago
> still-not-boundary-checked [...] std::vector
Huh? vector::at() is boundary-checked. So you can choose whether you want to pay for boundary-checking or not.
- roel_v 13y agoYou can't switch between .at() and [] between two builds. There is a lot to be said about MSVC's checked iterators, but it sure does catch a lot of mistakes during debug builds. Any sane STL implementation should have something similar.
- jzwinck 13y ago#define at operator [] I kid...mostly.
- jzwinck 13y ago#define at operator [] I kid...mostly.
- sltkr 13y agoFYI, with libstdc++ (GCC) you can define _GLIBCXX_DEBUG and get a lot of runtime checks too, including bounds checking on vectors. http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch30s04.html http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch30s...