diff options
Diffstat (limited to 'src/corelib/tools/qlist.h')
-rw-r--r-- | src/corelib/tools/qlist.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index e2706de9ee..af7659e995 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -231,7 +231,7 @@ public: typedef T *pointer; typedef T &reference; - inline iterator() Q_DECL_NOTHROW : i(Q_NULLPTR) {} + inline iterator() Q_DECL_NOTHROW : i(nullptr) {} inline iterator(Node *n) Q_DECL_NOTHROW : i(n) {} #if QT_VERSION < QT_VERSION_CHECK(6,0,0) // can't remove it in Qt 5, since doing so would make the type trivial, @@ -283,7 +283,7 @@ public: typedef const T *pointer; typedef const T &reference; - inline const_iterator() Q_DECL_NOTHROW : i(Q_NULLPTR) {} + inline const_iterator() Q_DECL_NOTHROW : i(nullptr) {} inline const_iterator(Node *n) Q_DECL_NOTHROW : i(n) {} #if QT_VERSION < QT_VERSION_CHECK(6,0,0) // can't remove it in Qt 5, since doing so would make the type trivial, @@ -555,14 +555,14 @@ inline void QList<T>::removeAt(int i) template <typename T> inline T QList<T>::takeAt(int i) { Q_ASSERT_X(i >= 0 && i < p.size(), "QList<T>::take", "index out of range"); - detach(); Node *n = reinterpret_cast<Node *>(p.at(i)); T t = n->t(); node_destruct(n); + detach(); Node *n = reinterpret_cast<Node *>(p.at(i)); T t = std::move(n->t()); node_destruct(n); p.remove(i); return t; } template <typename T> inline T QList<T>::takeFirst() -{ T t = first(); removeFirst(); return t; } +{ T t = std::move(first()); removeFirst(); return t; } template <typename T> inline T QList<T>::takeLast() -{ T t = last(); removeLast(); return t; } +{ T t = std::move(last()); removeLast(); return t; } template <typename T> Q_OUTOFLINE_TEMPLATE void QList<T>::reserve(int alloc) |