So, I have a situation where I need to see if an object is on my stl map. If it is not, I am going to add it.
char symbolName[] = { 'H', 'e', 'l', 'l', 'o', '\0' }; map<string,TheObject> theMap; if (theMap.find(symbolName)==theMap.end()) { TheObject theObject(symbolName); theMap.insert(pair<string, TheObject>(symbolName, theObject)); }
I get a core dump: theMap.find when the object is not already on the map. Presumably, if the item is not on the map, it should return an iterator equal to display :: end
What's going on here?
GCC: 3.4.6
source share