diff options
Diffstat (limited to 'src/corelib/global/qtypeinfo.h')
-rw-r--r-- | src/corelib/global/qtypeinfo.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 7759eff370..ccc765009f 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -117,6 +117,12 @@ public: static constexpr bool isIntegral = 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 T1, class T2> +class QTypeInfo<std::pair<T1, T2>> : public QTypeInfoMerger<std::pair<T1, T2>, T1, T2> {}; + #define Q_DECLARE_MOVABLE_CONTAINER(CONTAINER) \ template <typename ...T> \ class QTypeInfo<CONTAINER<T...>> \ @@ -165,7 +171,7 @@ public: \ enum { \ isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0) && !std::is_trivial_v<TYPE>, \ isRelocatable = !isComplex || ((FLAGS) & Q_RELOCATABLE_TYPE) || qIsRelocatable<TYPE>, \ - isPointer = false, \ + isPointer = std::is_pointer_v< TYPE >, \ isIntegral = std::is_integral< TYPE >::value, \ }; \ } |