yes, the solution i posted only goes to size()-1
for that reason. by default in gcc
and clang
accessing a vector with [] doesn't do bound checks for performance reasons. in visual studio it only does them in debug but not in release. with gcc, you can enable it by adding a define when compiling: -D_GLIBCXX_DEBUG
or when using clang with libc++ (the default in osx since 0.9) with -D_LIBCPP_DEBUG
↧
Best way to draw an array of objects
↧