STL map - insert or update
Posted
by CodeJunkie
on Stack Overflow
See other posts from Stack Overflow
or by CodeJunkie
Published on 2010-05-07T06:32:28Z
Indexed on
2010/05/07
6:38 UTC
Read the original article
Hit count: 205
I have a map of objects and I want to update the object mapped to a key, or create a new object and insert into the map. The update is done by a different function that takes a pointer to the object (void update(MyClass *obj))
What is the best way to "insert or update" an element in a map?
© Stack Overflow or respective owner