c++ - Does insertion to STL map invalidate other existing iterator? -


i used std::map in stl. can use iterator after other element inserted map? still valid?

when in doubt semantics of operation on container, consult the documentation:

map has important property inserting new element map not invalidate iterators point existing elements.

erasing element map not invalidate iterators, except, of course, iterators point element being erased.

this taken sgi stl documentation. while documentation technically not specify behavior of c++ standard library containers, differences insignificant, aside parts of stl not part of c++ standard library, of course.

the sgi stl documentation indispensable reference, if don't have copy of c++ standard.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -