There is also _GLIBCXX_DEBUG - if you have defined this symbol, glibc will use safer variant of std::vector, iterators etc, which asserts when you attempt to do bad things like reading out of range.
Yup. SaferCPlusPlus has vector and array substitutes that will also catch "use-after-free" bugs and use of invalid iterators. Clang/LLVM and gcc also provide "sanitizers" with much more comprehensive checking. But there are still situations when you'd want to use SaferCPlusPlus [1].