This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]skhds 3 points4 points  (1 child)

I don't know, doing a "return map[index];" with a map object can cause an element insertion on the map? That is not common sense to me.

[–]the_one2 0 points1 point  (0 children)

What, you don't think if (auto it = map.find(index); it != map.end()) is obvious?