Quick Q: insert vs emplace vs operator[] in c++ map

Save to:
Instapaper Pocket Readability

Quick A: the difference is in the performance and the behaviour in case an element is not already inserted.

Recently on SO:

insert vs emplace vs operator[] in c++ map

In the particular case of a map the old options were only two: operator[] and insert (different flavors of insert). So I will start explaining those...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.