My program is inserting (with [] operator]) some data[addresses] into the std::map. I can track inserting of 137 elements.They all are inserted with valid values.
In some stage I iterate the map and try to do some manipulation with the values[addresses]
I`ve set a breakpoint right before I start to iterate the map.
When I check the map in debugger I still see 137 elements.But when I iterate it until the
iterator != map.end I discover ,that the map has 138 values – the last one is illegal.
I need to find a way to detect when this last problematic value is inserted.I use VS 2010.
Thank you
You could try placing conditional breakpoints in the insertion functions of
std::mapFor me (using VC10), the appropriate places are line 755 (for
std::map::insert) and line 767 (forstd::map::operator[]) of C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xtreeYou can add a condition on each breakpoint of
_Mysize == 137to catch the insertion which increases themapsize to 138.The most likely culprit is probably the
operator[]since it’s easy to mistakenly think of this as an accessor only.