path: root/src/corelib/tools/qvarlengtharray.qdoc
diff options
authorMarc Mutz <>2012-05-24 08:26:46 +0200
committerQt by Nokia <>2012-08-30 02:28:51 +0200
commitc2f10f915fd6fa4d38c83a4c8b0e1c63a254643a (patch)
tree2e74c6e8ba593b044faefceea2de423a54910173 /src/corelib/tools/qvarlengtharray.qdoc
parent6276427438d8247348f3bc9643d915d725f229d8 (diff)
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 <> Reviewed-by: Thiago Macieira <>
Diffstat (limited to 'src/corelib/tools/qvarlengtharray.qdoc')
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index fbd984e62b..45eab98731 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -504,7 +504,7 @@
\sa constBegin(), end()
-/*! \fn QVarLengthArray::iterator QVarLengthArray::erase(iterator pos)
+/*! \fn QVarLengthArray::iterator QVarLengthArray::erase(const_iterator pos)
\since 4.8
Removes the item pointed to by the iterator \a pos from the
@@ -514,7 +514,7 @@
\sa insert(), remove()
-/*! \fn QVarLengthArray::iterator QVarLengthArray::erase(iterator begin, iterator end)
+/*! \fn QVarLengthArray::iterator QVarLengthArray::erase(const_iterator begin, const_iterator end)
\since 4.8
@@ -549,7 +549,7 @@
-/*! \fn QVarLengthArray::iterator QVarLengthArray::insert(iterator before, const T &value)
+/*! \fn QVarLengthArray::iterator QVarLengthArray::insert(const_iterator before, const T &value)
\since 4.8
@@ -558,7 +558,7 @@
\a before. Returns an iterator pointing at the inserted item.
-/*! \fn QVarLengthArray::iterator QVarLengthArray::insert(iterator before, int count, const T &value)
+/*! \fn QVarLengthArray::iterator QVarLengthArray::insert(const_iterator before, int count, const T &value)
\since 4.8
Inserts \a count copies of \a value in front of the item pointed to