c++ - Does hash_map.erase invalidate all iterators? -
std::hash_map
not part of c++ standard
part of extensions standard library. example defined vs2005. std::hash_map.erase
invalidate iterators std::hash_map
? presumably, memory can reallocated smaller array when elements removed optimize memory usage.
so hash_map.erase
invalidate iterators?
it looks specified in vs2005 example in documentation:
each element contains separate key , mapped value. sequence represented in way permits lookup, insertion, , removal of arbitrary element number of operations independent of number of elements in sequence (constant time) -- @ least in best of cases. moreover, inserting element invalidates no iterators, , removing element invalidates iterators point @ removed element.
Comments
Post a Comment