diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qlinkedlist.h | 7 | ||||
-rw-r--r-- | src/corelib/tools/qlist.h | 7 | ||||
-rw-r--r-- | src/corelib/tools/qset.h | 7 | ||||
-rw-r--r-- | src/corelib/tools/qvarlengtharray.h | 7 | ||||
-rw-r--r-- | src/corelib/tools/qvector.h | 7 |
5 files changed, 35 insertions, 0 deletions
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h index 996a50fd1b..8970d39be0 100644 --- a/src/corelib/tools/qlinkedlist.h +++ b/src/corelib/tools/qlinkedlist.h @@ -275,6 +275,13 @@ private: template <typename T> Q_DECLARE_TYPEINFO_BODY(QLinkedList<T>, Q_MOVABLE_TYPE|Q_RELOCATABLE_TYPE); +#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606 +template <typename InputIterator, + typename ValueType = typename std::iterator_traits<InputIterator>::value_type, + QtPrivate::IfIsInputIterator<InputIterator> = true> +QLinkedList(InputIterator, InputIterator) -> QLinkedList<ValueType>; +#endif + template <typename T> inline QLinkedList<T>::~QLinkedList() { diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 70bbc11ad2..471e16886f 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -446,6 +446,13 @@ private: inline int count_impl(const T &, QListData::ArrayCompatibleLayout) const; }; +#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606 +template <typename InputIterator, + typename ValueType = typename std::iterator_traits<InputIterator>::value_type, + QtPrivate::IfIsInputIterator<InputIterator> = true> +QList(InputIterator, InputIterator) -> QList<ValueType>; +#endif + #if defined(Q_CC_BOR) template <typename T> Q_INLINE_TEMPLATE T &QList<T>::Node::t() diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index 19d6982133..2e72832185 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -269,6 +269,13 @@ private: } }; +#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606 +template <typename InputIterator, + typename ValueType = typename std::iterator_traits<InputIterator>::value_type, + QtPrivate::IfIsInputIterator<InputIterator> = true> +QSet(InputIterator, InputIterator) -> QSet<ValueType>; +#endif + template <typename T> uint qHash(const QSet<T> &key, uint seed = 0) noexcept(noexcept(qHashRangeCommutative(key.begin(), key.end(), seed))) diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 2f62526076..253d05ba2b 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -265,6 +265,13 @@ private: } }; +#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606 +template <typename InputIterator, + typename ValueType = typename std::iterator_traits<InputIterator>::value_type, + QtPrivate::IfIsInputIterator<InputIterator> = true> +QVarLengthArray(InputIterator, InputIterator) -> QVarLengthArray<ValueType>; +#endif + template <class T, int Prealloc> Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(int asize) : s(asize) { diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index ebe6527d89..62fbdb4a2a 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -326,6 +326,13 @@ private: class AlignmentDummy { Data header; T array[1]; }; }; +#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606 +template <typename InputIterator, + typename ValueType = typename std::iterator_traits<InputIterator>::value_type, + QtPrivate::IfIsInputIterator<InputIterator> = true> +QVector(InputIterator, InputIterator) -> QVector<ValueType>; +#endif + #ifdef Q_CC_MSVC // behavior change: an object of POD type constructed with an initializer of the form () // will be default-initialized |