Original Post
🔒 Locked
VERY quick question
Advertisement
Bad things. Don't do that. Use map::find intead. That'll return an iterator. If the iterator == map::end() then it didn't find it.
Edit: btw, that map::end() means yourmap.end(); it's not a static method or anything. Same for find().
Edit again: Ok, actually, if you do map["not existant item"] the map will actually insert the item into the map. But this may not necessarily be desirable, so use insert() and find() instead.
Edit: btw, that map::end() means yourmap.end(); it's not a static method or anything. Same for find().
Edit again: Ok, actually, if you do map["not existant item"] the map will actually insert the item into the map. But this may not necessarily be desirable, so use insert() and find() instead.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement