c++ - Are vectors more rigorous at checking out of bounds than heap arrays? -


How much rigorous testing is done on vectors compared to Hep arrays? How exactly is it checking the boundary and how does it compare how a heap array is checked?

A vector if you type () Function, it will cross the check limit, for example:

  std :: vector  

However, if you use the operator [] , no limits are being checked ( And because of reaching non-existence elements, there is an undefined behavior.)

It should be noted that in most implementations, there will be a possibility to include border investigations on all those Air Force Answer is done. By default, on VS2008 and below it's debug and release, VS2010 only does the debug. To check GCC you must define _GLIBCXX_DEBUG to get the AF checked.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -