diff options
-rw-r--r-- | src/corelib/tools/qlist.h | 10 | ||||
-rw-r--r-- | src/corelib/tools/qvarlengtharray.h | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 38cc0ed348..40ee923cd4 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -68,12 +68,12 @@ protected: const Self *self() const { return static_cast<const Self *>(this); } public: - template <typename AT> + template <typename AT = T> qsizetype indexOf(const AT &t, qsizetype from = 0) const noexcept; - template <typename AT> + template <typename AT = T> qsizetype lastIndexOf(const AT &t, qsizetype from = -1) const noexcept; - template <typename AT> + template <typename AT = T> bool contains(const AT &t) const noexcept { return self()->indexOf(t) != -1; @@ -360,7 +360,7 @@ public: // QList compatibility void removeAt(qsizetype i) { remove(i); } - template <typename AT> + template <typename AT = T> qsizetype removeAll(const AT &t) { const const_iterator ce = this->cend(), cit = std::find(this->cbegin(), ce, t); @@ -381,7 +381,7 @@ public: erase(it, e); return result; } - template <typename AT> + template <typename AT = T> bool removeOne(const AT &t) { const qsizetype i = indexOf(t); diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index d7e1941539..0bbee4f36e 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -190,11 +190,11 @@ public: inline qsizetype capacity() const { return a; } inline void reserve(qsizetype size); - template <typename AT> + template <typename AT = T> inline qsizetype indexOf(const AT &t, qsizetype from = 0) const; - template <typename AT> + template <typename AT = T> inline qsizetype lastIndexOf(const AT &t, qsizetype from = -1) const; - template <typename AT> + template <typename AT = T> inline bool contains(const AT &t) const; inline T &operator[](qsizetype idx) |