QVarLengthArray: C++11-ify insert/erase signatures
authorMarc Mutz <marc.mutz@kdab.com>
Thu, 24 May 2012 06:26:46 +0000 (08:26 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 30 Aug 2012 00:28:51 +0000 (02:28 +0200)
commitc2f10f915fd6fa4d38c83a4c8b0e1c63a254643a
tree2e74c6e8ba593b044faefceea2de423a54910173
parent6276427438d8247348f3bc9643d915d725f229d8
QVarLengthArray: C++11-ify insert/erase signatures

In C++11, container insert and erase operations take const_iterators
instead of iterators. This is a bug fix compared to C++98, where the
mere lookup step of a lookup-or-insert operation had to be done using
(mutable) iterators, which is particularly worrisome for Qt containers
that are implicitly shared, because of the unneeded detach in the positive
case.

QVarLengthArray is not implicitly shared, but for consistency, the signatures
should be changed here, too. The reason this commit contains only the change
to QVarLengthArray is that this is by far the easiest container. The
implictly shared containers are harder, because detaching invalidates other
iterators (more than the sister STL container would).

Change-Id: Ib3d98360bfe376b782b9d1283c5fa3555e8a719e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qvarlengtharray.h
src/corelib/tools/qvarlengtharray.qdoc