diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 34cf1de4f55..e16ffb08eec 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -170,24 +170,20 @@ struct QTypeInfoQuery::isRelocatable || \snippet code/src_corelib_global_qglobal.cpp 51 */ -template +template class QTypeInfoMerger { + static_assert(sizeof...(Ts) > 0); public: - enum { - isSpecialized = true, - isComplex = QTypeInfoQuery::isComplex || QTypeInfoQuery::isComplex - || QTypeInfoQuery::isComplex || QTypeInfoQuery::isComplex, - isStatic = QTypeInfoQuery::isStatic || QTypeInfoQuery::isStatic - || QTypeInfoQuery::isStatic || QTypeInfoQuery::isStatic, - isRelocatable = QTypeInfoQuery::isRelocatable && QTypeInfoQuery::isRelocatable - && QTypeInfoQuery::isRelocatable && QTypeInfoQuery::isRelocatable, - isLarge = sizeof(T) > sizeof(void*), - isPointer = false, - isIntegral = false, - isDummy = false, - sizeOf = sizeof(T) - }; + static constexpr bool isSpecialized = true; + static constexpr bool isComplex = ((QTypeInfoQuery::isComplex) || ...); + static constexpr bool isStatic = ((QTypeInfoQuery::isStatic) || ...); + static constexpr bool isRelocatable = ((QTypeInfoQuery::isRelocatable) && ...); + static constexpr bool isLarge = sizeof(T) > sizeof(void*); + static constexpr bool isPointer = false; + static constexpr bool isIntegral = false; + static constexpr bool isDummy = false; + static constexpr std::size_t sizeOf = sizeof(T); }; #define Q_DECLARE_MOVABLE_CONTAINER(CONTAINER) \