From c2f10f915fd6fa4d38c83a4c8b0e1c63a254643a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 24 May 2012 08:26:46 +0200 Subject: QVarLengthArray: C++11-ify insert/erase signatures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/corelib/tools/qvarlengtharray.qdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/tools/qvarlengtharray.qdoc') 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) \overload \since 4.8 @@ -549,7 +549,7 @@ vector. */ -/*! \fn QVarLengthArray::iterator QVarLengthArray::insert(iterator before, const T &value) +/*! \fn QVarLengthArray::iterator QVarLengthArray::insert(const_iterator before, const T &value) \overload \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 -- cgit v1.2.3