[Interest] Qmap insert versus operator[]

Olivier BARTHELEMY barthelemy at geovariances.com
Tue Nov 5 13:45:07 CET 2013


Given code that would look like :

QMap<SomeType> theMap;
  theMap[someIndex] = someValue;

Is it safe to assume that replacing the operator with the insert method
will improve the performance for new elements (copy constructor used
directly instead of default constructor + assignment operator ), while not
being slower for the modification of an element that already exists?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131105/f581f57a/attachment.html>

More information about the Interest mailing list