From 85e92f2e5f1d90fceac5d83cc97f8efc4f276397 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 7 Dec 2021 15:48:35 +0100 Subject: QVarLengthArray: deprecate prepend() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All Qt 6 containers have "fast" prepend these days. Except QVLA. Instead of enabling "fast" prepend for QVLA, slowing down idiomatic QVLA use, simply deprecate prepend(). There appear to be no users of this function in qtbase outside tests. [ChangeLog][QtCore][Deprecation Notices][QVarLengthArray] Deprecated prepend() because QVarLengthArray is the only Qt container without a "fast" prepend. If you require that functionality, even though it's a linear operation, then use insert(cbegin(), ~~~) instead. Change-Id: I39ff1dd7d4de7fc08d5380a5a7450dd8c8996fe2 Reviewed-by: MÃ¥rten Nordheim --- src/corelib/tools/qvarlengtharray.qdoc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/corelib/tools/qvarlengtharray.qdoc') diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc index b7e6cd6d6e..de57daf4e4 100644 --- a/src/corelib/tools/qvarlengtharray.qdoc +++ b/src/corelib/tools/qvarlengtharray.qdoc @@ -545,6 +545,8 @@ \fn template void QVarLengthArray::prepend(T &&value) \since 4.8 + \deprecated [6.3] This is slow. If you must, use \c{insert(cbegin(), ~~~)} instead. + Inserts \a value at the beginning of the array. -- cgit v1.2.3