summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-03-05 20:37:42 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-03-07 18:36:40 +0000
commit4dee5446bee9c7417bf6f5dc44294a0b7238a9ba (patch)
tree533379da0c5f054f0f9cd10d75987fa2ad2fa724
parent808adeb7bc53208a1c30f425fce6359a17f00170 (diff)
Add missing rvalue overloads of operator+=() and operator<<()
They were forgotten when the overloads for append()/push_back() were added in Qt 5.6 [ChangeLog][QtCore][QVarLengthArray] Added missing rvalue overload of operator+=() and operator<<() [ChangeLog][QtCore][QVector] Added missing rvalue overload of operator+=() and operator<<() Change-Id: I20fedfba2bf282773bd1f9cf2c8ec06f05896a7d Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r--src/corelib/tools/qvarlengtharray.h4
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc16
-rw-r--r--src/corelib/tools/qvector.h4
-rw-r--r--src/corelib/tools/qvector.qdoc17
4 files changed, 41 insertions, 0 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index d0088471c7..bc22ea26f6 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -175,8 +175,12 @@ public:
void append(const T *buf, int size);
inline QVarLengthArray<T, Prealloc> &operator<<(const T &t)
{ append(t); return *this; }
+ inline QVarLengthArray<T, Prealloc> &operator<<(T &&t)
+ { append(t); return *this; }
inline QVarLengthArray<T, Prealloc> &operator+=(const T &t)
{ append(t); return *this; }
+ inline QVarLengthArray<T, Prealloc> &operator+=(T &&t)
+ { append(t); return *this; }
void prepend(T &&t);
void prepend(const T &t);
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index 336f2afaca..bc8df82517 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -832,6 +832,14 @@
\sa append(), operator+=()
*/
+/*! \fn template<class T, int Prealloc> QVarLengthArray<T, Prealloc> &QVarLengthArray<T, Prealloc>::operator<<(T &&value)
+ \since 5.11
+
+ \overload
+
+ \sa append(), operator+=()
+*/
+
/*! \fn template<class T, int Prealloc> QVarLengthArray<T, Prealloc> &QVarLengthArray<T, Prealloc>::operator+=(const T &value)
\since 4.8
@@ -840,6 +848,14 @@
\sa append(), operator<<()
*/
+/*! \fn template<class T, int Prealloc> QVarLengthArray<T, Prealloc> &QVarLengthArray<T, Prealloc>::operator+=(T &&value)
+ \since 5.11
+
+ \overload
+
+ \sa append(), operator<<()
+*/
+
/*! \fn template<class T, int Prealloc> int QVarLengthArray<T, Prealloc>::indexOf(const T &value, int from = 0) const
\since 5.3
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index a01d5c8f3c..e4c7fd06d8 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -283,6 +283,10 @@ public:
{ append(t); return *this; }
inline QVector<T> &operator<<(const QVector<T> &l)
{ *this += l; return *this; }
+ inline QVector<T> &operator+=(T &&t)
+ { append(t); return *this; }
+ inline QVector<T> &operator<<(T &&t)
+ { append(t); return *this; }
QList<T> toList() const;
diff --git a/src/corelib/tools/qvector.qdoc b/src/corelib/tools/qvector.qdoc
index cc250b72a5..9a08b030f7 100644
--- a/src/corelib/tools/qvector.qdoc
+++ b/src/corelib/tools/qvector.qdoc
@@ -1162,6 +1162,14 @@
\sa append(), operator<<()
*/
+/*! \fn template <typename T> void QVector<T>::operator+=(T &&value)
+ \since 5.11
+
+ \overload
+
+ \sa append(), operator<<()
+*/
+
/*! \fn template <typename T> QVector<T> QVector<T>::operator+(const QVector<T> &other) const
Returns a vector that contains all the items in this vector
@@ -1178,6 +1186,15 @@
\sa append(), operator+=()
*/
+/*! \fn template <typename T> QVector<T> &QVector<T>::operator<<(T &&value)
+ \since 5.11
+
+ \overload
+
+ \sa append(), operator+=()
+*/
+
+
/*! \fn template <typename T> QVector<T> &QVector<T>::operator<<(const QVector<T> &other)
Appends \a other to the vector and returns a reference to the