diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 4165fe0a79..349382be46 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -94,6 +94,12 @@ public: static constexpr bool isValueInitializationBitwiseZero = false; }; +// QTypeInfo for std::pair: +// std::pair is spec'ed to be struct { T1 first; T2 second; }, so, unlike tuple<>, +// we _can_ specialize QTypeInfo for pair<>: +template +class QTypeInfo> : public QTypeInfoMerger, T1, T2> {}; + #define Q_DECLARE_MOVABLE_CONTAINER(CONTAINER) \ template \ class QTypeInfo> \ diff --git a/src/corelib/tools/qpair.h b/src/corelib/tools/qpair.h index 75efaed3cf..8070ca0175 100644 --- a/src/corelib/tools/qpair.h +++ b/src/corelib/tools/qpair.h @@ -22,9 +22,6 @@ constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) return std::make_pair(std::forward(value1), std::forward(value2)); } -template -class QTypeInfo> : public QTypeInfoMerger, T1, T2> {}; - QT_END_NAMESPACE #endif // QPAIR_H