What does enabling STL iterator debugging really do?

前端 未结 3 1794
日久生厌
日久生厌 2021-01-04 18:51

I\'ve enabled iterator debugging in an application by defining

_HAS_ITERATOR_DEBUGGING = 1

I was expecting this to really just check vector

3条回答
  •  半阙折子戏
    2021-01-04 19:08

    According to http://msdn.microsoft.com/en-us/library/aa985982%28v=VS.80%29.aspx

    The C++ standard describes which member functions cause iterators to a container to become invalid. Two examples are:

    • Erasing an element from a container causes iterators to the element to become invalid.
    • Increasing the size of a vector (push or insert) causes iterators into the vector container become invalid.

提交回复
热议问题