www.digitalmars.com         C & C++   DMDScript  

c++.stl.port - Removing keys from hash_map

reply Mark Evans <Mark_member pathlink.com> writes:
Is this even possible?  It seems that once a key is inserted, there is no way to
remove it from the hash_map.

I can erase() the entry, but that does not eliminate the key.  Instead it
replaces the associated object with a default-constructed object under the same
key.  Keys never go away!

I want to eliminate key/entry pairs *entirely* from an STLport hash_map.  How?

Mark
Sep 02 2002
parent Mark Evans <Mark_member pathlink.com> writes:
My bad.  It is possible.  The code I'm dealing with uses an auxiliary STL
structure containing just the keys, so a second erasure was necessary.
Sep 02 2002