diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qnumeric_p.h | 4 | ||||
-rw-r--r-- | src/corelib/global/qtypeinfo.h | 2 | ||||
-rw-r--r-- | src/corelib/io/qdebug.h | 12 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 8 | ||||
-rw-r--r-- | src/corelib/kernel/qobject.h | 10 | ||||
-rw-r--r-- | src/corelib/kernel/qtimer.h | 16 | ||||
-rw-r--r-- | src/corelib/thread/qgenericatomic.h | 24 | ||||
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 8 | ||||
-rw-r--r-- | src/corelib/tools/qarraydataops.h | 8 | ||||
-rw-r--r-- | src/corelib/tools/qmap.h | 4 | ||||
-rw-r--r-- | src/corelib/tools/qsharedpointer_impl.h | 4 |
11 files changed, 50 insertions, 50 deletions
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h index 01b8772ee1..62add95533 100644 --- a/src/corelib/global/qnumeric_p.h +++ b/src/corelib/global/qnumeric_p.h @@ -174,7 +174,7 @@ static inline bool qt_is_finite(float f) // Unsigned overflow math // namespace { -template <typename T> inline typename QtPrivate::QEnableIf<std::is_unsigned<T>::value, bool>::Type +template <typename T> inline typename std::enable_if<std::is_unsigned<T>::value, bool>::type add_overflow(T v1, T v2, T *r) { // unsigned additions are well-defined @@ -182,7 +182,7 @@ add_overflow(T v1, T v2, T *r) return v1 > T(v1 + v2); } -template <typename T> inline typename QtPrivate::QEnableIf<std::is_unsigned<T>::value, bool>::Type +template <typename T> inline typename std::enable_if<std::is_unsigned<T>::value, bool>::type mul_overflow(T v1, T v2, T *r) { // use the next biggest type diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 8aa5cb4fb4..53f6b3fff6 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -124,7 +124,7 @@ struct QTypeInfoQuery : public QTypeInfo<T> // if QTypeInfo<T>::isRelocatable exists, use it template <typename T> -struct QTypeInfoQuery<T, typename QtPrivate::QEnableIf<QTypeInfo<T>::isRelocatable || true>::Type> : public QTypeInfo<T> +struct QTypeInfoQuery<T, typename std::enable_if<QTypeInfo<T>::isRelocatable || true>::type> : public QTypeInfo<T> {}; /*! diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index abc2abeaec..61059dd694 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -365,7 +365,7 @@ Q_CORE_EXPORT QDebug qt_QMetaEnum_debugOperator(QDebug&, int value, const QMetaO Q_CORE_EXPORT QDebug qt_QMetaEnum_flagDebugOperator(QDebug &dbg, quint64 value, const QMetaObject *meta, const char *name); template<typename T> -typename QtPrivate::QEnableIf<QtPrivate::IsQEnumHelper<T>::Value, QDebug>::Type +typename std::enable_if<QtPrivate::IsQEnumHelper<T>::Value, QDebug>::type operator<<(QDebug dbg, T value) { const QMetaObject *obj = qt_getEnumMetaObject(value); @@ -374,9 +374,9 @@ operator<<(QDebug dbg, T value) } template <class T> -inline typename QtPrivate::QEnableIf< +inline typename std::enable_if< QtPrivate::IsQEnumHelper<T>::Value || QtPrivate::IsQEnumHelper<QFlags<T> >::Value, - QDebug>::Type + QDebug>::type qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags) { const QMetaObject *obj = qt_getEnumMetaObject(T()); @@ -385,9 +385,9 @@ qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags) } template <class T> -inline typename QtPrivate::QEnableIf< +inline typename std::enable_if< !QtPrivate::IsQEnumHelper<T>::Value && !QtPrivate::IsQEnumHelper<QFlags<T> >::Value, - QDebug>::Type + QDebug>::type qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags<T> &flags) #else // !QT_NO_QOBJECT && !Q_QDOC template <class T> @@ -402,7 +402,7 @@ template<typename T> inline QDebug operator<<(QDebug debug, const QFlags<T> &flags) { // We have to use an indirection otherwise specialisation of some other overload of the - // operator<< the compiler would try to instantiate QFlags<T> for the QEnableIf + // operator<< the compiler would try to instantiate QFlags<T> for the std::enable_if return qt_QMetaEnum_flagDebugOperator_helper(debug, flags); } diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 7b0a9f986b..3674ebc1a1 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -1413,17 +1413,17 @@ namespace QtPrivate static inline const QMetaObject *value() { return Q_NULLPTR; } }; template<typename T> - struct MetaObjectForType<T*, typename QEnableIf<IsPointerToTypeDerivedFromQObject<T*>::Value>::Type> + struct MetaObjectForType<T*, typename std::enable_if<IsPointerToTypeDerivedFromQObject<T*>::Value>::type> { static inline const QMetaObject *value() { return &T::staticMetaObject; } }; template<typename T> - struct MetaObjectForType<T, typename QEnableIf<IsGadgetHelper<T>::Value>::Type> + struct MetaObjectForType<T, typename std::enable_if<IsGadgetHelper<T>::Value>::type> { static inline const QMetaObject *value() { return &T::staticMetaObject; } }; template<typename T> - struct MetaObjectForType<T, typename QEnableIf<IsQEnumHelper<T>::Value>::Type > + struct MetaObjectForType<T, typename std::enable_if<IsQEnumHelper<T>::Value>::type > { static inline const QMetaObject *value() { return qt_getEnumMetaObject(T()); } }; @@ -2009,7 +2009,7 @@ struct SharedPointerMetaTypeIdHelper<SMART_POINTER<T>, true> \ }; \ template<typename T> \ struct MetaTypeSmartPointerHelper<SMART_POINTER<T> , \ - typename QEnableIf<IsPointerToTypeDerivedFromQObject<T*>::Value >::Type> \ + typename std::enable_if<IsPointerToTypeDerivedFromQObject<T*>::Value>::type> \ { \ static bool registerConverter(int id) \ { \ diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index d42eb2a13d..6941c55896 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -261,7 +261,7 @@ public: //connect to a function pointer (not a member) template <typename Func1, typename Func2> - static inline typename QtPrivate::QEnableIf<int(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0, QMetaObject::Connection>::Type + static inline typename std::enable_if<int(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0, QMetaObject::Connection>::type connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot) { return connect(sender, signal, sender, slot, Qt::DirectConnection); @@ -269,8 +269,8 @@ public: //connect to a function pointer (not a member) template <typename Func1, typename Func2> - static inline typename QtPrivate::QEnableIf<int(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0 && - !QtPrivate::FunctionPointer<Func2>::IsPointerToMemberFunction, QMetaObject::Connection>::Type + static inline typename std::enable_if<int(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0 && + !QtPrivate::FunctionPointer<Func2>::IsPointerToMemberFunction, QMetaObject::Connection>::type connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type = Qt::AutoConnection) { @@ -301,7 +301,7 @@ public: //connect to a functor template <typename Func1, typename Func2> - static inline typename QtPrivate::QEnableIf<QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1, QMetaObject::Connection>::Type + static inline typename std::enable_if<QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1, QMetaObject::Connection>::type connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot) { return connect(sender, signal, sender, slot, Qt::DirectConnection); @@ -309,7 +309,7 @@ public: //connect to a functor, with a "context" object defining in which event loop is going to be executed template <typename Func1, typename Func2> - static inline typename QtPrivate::QEnableIf<QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1, QMetaObject::Connection>::Type + static inline typename std::enable_if<QtPrivate::FunctionPointer<Func2>::ArgumentCount == -1, QMetaObject::Connection>::type connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type = Qt::AutoConnection) { diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h index 96c7efd8f5..d3b1fd6a18 100644 --- a/src/corelib/kernel/qtimer.h +++ b/src/corelib/kernel/qtimer.h @@ -118,30 +118,30 @@ public: } // singleShot to a functor or function pointer (without context) template <typename Duration, typename Func1> - static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction && - !std::is_same<const char*, Func1>::value, void>::Type + static inline typename std::enable_if<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction && + !std::is_same<const char*, Func1>::value, void>::type singleShot(Duration interval, Func1 slot) { singleShot(interval, defaultTypeFor(interval), nullptr, slot); } template <typename Duration, typename Func1> - static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction && - !std::is_same<const char*, Func1>::value, void>::Type + static inline typename std::enable_if<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction && + !std::is_same<const char*, Func1>::value, void>::type singleShot(Duration interval, Qt::TimerType timerType, Func1 slot) { singleShot(interval, timerType, nullptr, slot); } // singleShot to a functor or function pointer (with context) template <typename Duration, typename Func1> - static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction && - !std::is_same<const char*, Func1>::value, void>::Type + static inline typename std::enable_if<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction && + !std::is_same<const char*, Func1>::value, void>::type singleShot(Duration interval, QObject *context, Func1 slot) { singleShot(interval, defaultTypeFor(interval), context, slot); } template <typename Duration, typename Func1> - static inline typename QtPrivate::QEnableIf<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction && - !std::is_same<const char*, Func1>::value, void>::Type + static inline typename std::enable_if<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction && + !std::is_same<const char*, Func1>::value, void>::type singleShot(Duration interval, Qt::TimerType timerType, QObject *context, Func1 slot) { //compilation error if the slot has arguments. diff --git a/src/corelib/thread/qgenericatomic.h b/src/corelib/thread/qgenericatomic.h index 06bb4bc8f1..5c4c02a2ec 100644 --- a/src/corelib/thread/qgenericatomic.h +++ b/src/corelib/thread/qgenericatomic.h @@ -283,7 +283,7 @@ template <typename BaseClass> struct QGenericAtomicOps } template <typename T> static Q_ALWAYS_INLINE - T fetchAndAndRelaxed(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndAndRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { // implement fetchAndAnd on top of testAndSet T tmp = BaseClass::load(_q_value); @@ -294,7 +294,7 @@ template <typename BaseClass> struct QGenericAtomicOps } template <typename T> static Q_ALWAYS_INLINE - T fetchAndAndAcquire(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndAndAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { T tmp = BaseClass::fetchAndAndRelaxed(_q_value, operand); BaseClass::acquireMemoryFence(_q_value); @@ -302,21 +302,21 @@ template <typename BaseClass> struct QGenericAtomicOps } template <typename T> static Q_ALWAYS_INLINE - T fetchAndAndRelease(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndAndRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::releaseMemoryFence(_q_value); return BaseClass::fetchAndAndRelaxed(_q_value, operand); } template <typename T> static Q_ALWAYS_INLINE - T fetchAndAndOrdered(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndAndOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::orderedMemoryFence(_q_value); return BaseClass::fetchAndAndRelaxed(_q_value, operand); } template <typename T> static Q_ALWAYS_INLINE - T fetchAndOrRelaxed(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndOrRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { // implement fetchAndOr on top of testAndSet T tmp = BaseClass::load(_q_value); @@ -327,7 +327,7 @@ template <typename BaseClass> struct QGenericAtomicOps } template <typename T> static Q_ALWAYS_INLINE - T fetchAndOrAcquire(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndOrAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { T tmp = BaseClass::fetchAndOrRelaxed(_q_value, operand); BaseClass::acquireMemoryFence(_q_value); @@ -335,21 +335,21 @@ template <typename BaseClass> struct QGenericAtomicOps } template <typename T> static Q_ALWAYS_INLINE - T fetchAndOrRelease(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndOrRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::releaseMemoryFence(_q_value); return BaseClass::fetchAndOrRelaxed(_q_value, operand); } template <typename T> static Q_ALWAYS_INLINE - T fetchAndOrOrdered(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndOrOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::orderedMemoryFence(_q_value); return BaseClass::fetchAndOrRelaxed(_q_value, operand); } template <typename T> static Q_ALWAYS_INLINE - T fetchAndXorRelaxed(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndXorRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { // implement fetchAndXor on top of testAndSet T tmp = BaseClass::load(_q_value); @@ -360,7 +360,7 @@ template <typename BaseClass> struct QGenericAtomicOps } template <typename T> static Q_ALWAYS_INLINE - T fetchAndXorAcquire(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndXorAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { T tmp = BaseClass::fetchAndXorRelaxed(_q_value, operand); BaseClass::acquireMemoryFence(_q_value); @@ -368,14 +368,14 @@ template <typename BaseClass> struct QGenericAtomicOps } template <typename T> static Q_ALWAYS_INLINE - T fetchAndXorRelease(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndXorRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::releaseMemoryFence(_q_value); return BaseClass::fetchAndXorRelaxed(_q_value, operand); } template <typename T> static Q_ALWAYS_INLINE - T fetchAndXorOrdered(T &_q_value, typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndXorOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::orderedMemoryFence(_q_value); return BaseClass::fetchAndXorRelaxed(_q_value, operand); diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index ba5f2dca95..c60742631b 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -211,25 +211,25 @@ static void clear_thread_data() } template <typename T> -static typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, Qt::HANDLE>::Type to_HANDLE(T id) +static typename std::enable_if<QTypeInfo<T>::isIntegral, Qt::HANDLE>::type to_HANDLE(T id) { return reinterpret_cast<Qt::HANDLE>(static_cast<intptr_t>(id)); } template <typename T> -static typename QtPrivate::QEnableIf<QTypeInfo<T>::isIntegral, T>::Type from_HANDLE(Qt::HANDLE id) +static typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type from_HANDLE(Qt::HANDLE id) { return static_cast<T>(reinterpret_cast<intptr_t>(id)); } template <typename T> -static typename QtPrivate::QEnableIf<QTypeInfo<T>::isPointer, Qt::HANDLE>::Type to_HANDLE(T id) +static typename std::enable_if<QTypeInfo<T>::isPointer, Qt::HANDLE>::type to_HANDLE(T id) { return id; } template <typename T> -static typename QtPrivate::QEnableIf<QTypeInfo<T>::isPointer, T>::Type from_HANDLE(Qt::HANDLE id) +static typename std::enable_if<QTypeInfo<T>::isPointer, T>::type from_HANDLE(Qt::HANDLE id) { return static_cast<T>(id); } diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h index 6bb8280ca8..47a19dd75d 100644 --- a/src/corelib/tools/qarraydataops.h +++ b/src/corelib/tools/qarraydataops.h @@ -411,18 +411,18 @@ struct QArrayOpsSelector template <class T> struct QArrayOpsSelector<T, - typename QEnableIf< + typename std::enable_if< !QTypeInfo<T>::isComplex && !QTypeInfo<T>::isStatic - >::Type> + >::type> { typedef QPodArrayOps<T> Type; }; template <class T> struct QArrayOpsSelector<T, - typename QEnableIf< + typename std::enable_if< QTypeInfo<T>::isComplex && !QTypeInfo<T>::isStatic - >::Type> + >::type> { typedef QMovableArrayOps<T> Type; }; diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 3f4f034b4e..e6da2820f8 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -99,10 +99,10 @@ struct Q_CORE_EXPORT QMapNodeBase void setParent(QMapNodeBase *pp) { p = (p & Mask) | quintptr(pp); } template <typename T> - static typename QtPrivate::QEnableIf<QTypeInfo<T>::isComplex>::Type + static typename std::enable_if<QTypeInfo<T>::isComplex>::type callDestructorIfNecessary(T &t) Q_DECL_NOTHROW { Q_UNUSED(t); t.~T(); } // Q_UNUSED: silence MSVC unused 't' warning template <typename T> - static typename QtPrivate::QEnableIf<!QTypeInfo<T>::isComplex>::Type + static typename std::enable_if<!QTypeInfo<T>::isComplex>::type callDestructorIfNecessary(T &) Q_DECL_NOTHROW {} }; diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 5738413bfb..0d42c8a212 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -974,13 +974,13 @@ qobject_cast(const QWeakPointer<T> &src) } template<typename T> -QWeakPointer<typename QtPrivate::QEnableIf<QtPrivate::IsPointerToTypeDerivedFromQObject<T*>::Value, T>::Type> +QWeakPointer<typename std::enable_if<QtPrivate::IsPointerToTypeDerivedFromQObject<T*>::Value, T>::type> qWeakPointerFromVariant(const QVariant &variant) { return QWeakPointer<T>(qobject_cast<T*>(QtSharedPointer::weakPointerFromVariant_internal(variant).data())); } template<typename T> -QSharedPointer<typename QtPrivate::QEnableIf<QtPrivate::IsPointerToTypeDerivedFromQObject<T*>::Value, T>::Type> +QSharedPointer<typename std::enable_if<QtPrivate::IsPointerToTypeDerivedFromQObject<T*>::Value, T>::type> qSharedPointerFromVariant(const QVariant &variant) { return qSharedPointerObjectCast<T>(QtSharedPointer::sharedPointerFromVariant_internal(variant)); |