From 30d0e1770c3d917d5bdae5e8766e401b4f1b4c2b Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Fri, 20 Jan 2017 15:58:10 +0300 Subject: Use std::enable_if instead of QEnableIf Change-Id: Ideca8283141484cb6da47c50333f5c96e416f082 Reviewed-by: Edward Welbourne Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/concurrent/qtconcurrentrun.h | 24 ++++++++++++------------ src/corelib/global/qnumeric_p.h | 4 ++-- src/corelib/global/qtypeinfo.h | 2 +- src/corelib/io/qdebug.h | 12 ++++++------ src/corelib/kernel/qmetatype.h | 8 ++++---- src/corelib/kernel/qobject.h | 10 +++++----- src/corelib/kernel/qtimer.h | 16 ++++++++-------- src/corelib/thread/qgenericatomic.h | 24 ++++++++++++------------ src/corelib/thread/qthread_unix.cpp | 8 ++++---- src/corelib/tools/qarraydataops.h | 8 ++++---- src/corelib/tools/qmap.h | 4 ++-- src/corelib/tools/qsharedpointer_impl.h | 4 ++-- src/network/socket/qnativesocketengine_p.h | 4 ++-- src/testlib/qtestcase.h | 4 ++-- src/widgets/widgets/qmenu.h | 8 ++++---- src/widgets/widgets/qtoolbar.h | 8 ++++---- 16 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/concurrent/qtconcurrentrun.h b/src/concurrent/qtconcurrentrun.h index 4b45a02b50..8e7c495a0f 100644 --- a/src/concurrent/qtconcurrentrun.h +++ b/src/concurrent/qtconcurrentrun.h @@ -101,7 +101,7 @@ QFuture run(T (*functionPointer)(Param1, Param2, Param3, Param4, Param5), con #if defined(Q_COMPILER_DECLTYPE) && defined(Q_COMPILER_AUTO_FUNCTION) template -auto run(Functor functor) -> typename QtPrivate::QEnableIf::Value, QFuture >::Type +auto run(Functor functor) -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor()) result_type; return (new StoredFunctorCall0(functor))->start(); @@ -109,7 +109,7 @@ auto run(Functor functor) -> typename QtPrivate::QEnableIf auto run(Functor functor, const Arg1 &arg1) - -> typename QtPrivate::QEnableIf::Value, QFuture >::Type + -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor(arg1)) result_type; return (new StoredFunctorCall1(functor, arg1))->start(); @@ -117,7 +117,7 @@ auto run(Functor functor, const Arg1 &arg1) template auto run(Functor functor, const Arg1 &arg1, const Arg2 &arg2) - -> typename QtPrivate::QEnableIf::Value, QFuture >::Type + -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor(arg1, arg2)) result_type; return (new StoredFunctorCall2(functor, arg1, arg2))->start(); @@ -125,7 +125,7 @@ auto run(Functor functor, const Arg1 &arg1, const Arg2 &arg2) template auto run(Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) - -> typename QtPrivate::QEnableIf::Value, QFuture >::Type + -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor(arg1, arg2, arg3)) result_type; return (new StoredFunctorCall3(functor, arg1, arg2, arg3))->start(); @@ -133,7 +133,7 @@ auto run(Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) template auto run(Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) - -> typename QtPrivate::QEnableIf::Value, QFuture >::Type + -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor(arg1, arg2, arg3, arg4)) result_type; return (new StoredFunctorCall4(functor, arg1, arg2, arg3, arg4))->start(); @@ -141,7 +141,7 @@ auto run(Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, template auto run(Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) - -> typename QtPrivate::QEnableIf::Value, QFuture >::Type + -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor(arg1, arg2, arg3, arg4, arg5)) result_type; return (new StoredFunctorCall5(functor, arg1, arg2, arg3, arg4, arg5))->start(); @@ -372,7 +372,7 @@ QFuture run(QThreadPool *pool, T (*functionPointer)(Param1, Param2, Param3, P #if defined(Q_COMPILER_DECLTYPE) && defined(Q_COMPILER_AUTO_FUNCTION) template -auto run(QThreadPool *pool, Functor functor) -> typename QtPrivate::QEnableIf::Value, QFuture >::Type +auto run(QThreadPool *pool, Functor functor) -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor()) result_type; return (new StoredFunctorCall0(functor))->start(pool); @@ -380,7 +380,7 @@ auto run(QThreadPool *pool, Functor functor) -> typename QtPrivate::QEnableIf auto run(QThreadPool *pool, Functor functor, const Arg1 &arg1) - -> typename QtPrivate::QEnableIf::Value, QFuture >::Type + -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor(arg1)) result_type; return (new StoredFunctorCall1(functor, arg1))->start(pool); @@ -388,7 +388,7 @@ auto run(QThreadPool *pool, Functor functor, const Arg1 &arg1) template auto run(QThreadPool *pool, Functor functor, const Arg1 &arg1, const Arg2 &arg2) - -> typename QtPrivate::QEnableIf::Value, QFuture >::Type + -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor(arg1, arg2)) result_type; return (new StoredFunctorCall2(functor, arg1, arg2))->start(pool); @@ -396,7 +396,7 @@ auto run(QThreadPool *pool, Functor functor, const Arg1 &arg1, const Arg2 &arg2) template auto run(QThreadPool *pool, Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3) - -> typename QtPrivate::QEnableIf::Value, QFuture >::Type + -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor(arg1, arg2, arg3)) result_type; return (new StoredFunctorCall3(functor, arg1, arg2, arg3))->start(pool); @@ -404,7 +404,7 @@ auto run(QThreadPool *pool, Functor functor, const Arg1 &arg1, const Arg2 &arg2, template auto run(QThreadPool *pool, Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4) - -> typename QtPrivate::QEnableIf::Value, QFuture >::Type + -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor(arg1, arg2, arg3, arg4)) result_type; return (new StoredFunctorCall4(functor, arg1, arg2, arg3, arg4))->start(pool); @@ -412,7 +412,7 @@ auto run(QThreadPool *pool, Functor functor, const Arg1 &arg1, const Arg2 &arg2, template auto run(QThreadPool *pool, Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3, const Arg4 &arg4, const Arg5 &arg5) - -> typename QtPrivate::QEnableIf::Value, QFuture >::Type + -> typename std::enable_if::Value, QFuture>::type { typedef decltype(functor(arg1, arg2, arg3, arg4, arg5)) result_type; return (new StoredFunctorCall5(functor, arg1, arg2, arg3, arg4, arg5))->start(pool); 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 inline typename QtPrivate::QEnableIf::value, bool>::Type +template inline typename std::enable_if::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 inline typename QtPrivate::QEnableIf::value, bool>::Type +template inline typename std::enable_if::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 // if QTypeInfo::isRelocatable exists, use it template -struct QTypeInfoQuery::isRelocatable || true>::Type> : public QTypeInfo +struct QTypeInfoQuery::isRelocatable || true>::type> : public QTypeInfo {}; /*! 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 QtPrivate::QEnableIf::Value, QDebug>::Type +typename std::enable_if::Value, QDebug>::type operator<<(QDebug dbg, T value) { const QMetaObject *obj = qt_getEnumMetaObject(value); @@ -374,9 +374,9 @@ operator<<(QDebug dbg, T value) } template -inline typename QtPrivate::QEnableIf< +inline typename std::enable_if< QtPrivate::IsQEnumHelper::Value || QtPrivate::IsQEnumHelper >::Value, - QDebug>::Type + QDebug>::type qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags &flags) { const QMetaObject *obj = qt_getEnumMetaObject(T()); @@ -385,9 +385,9 @@ qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags &flags) } template -inline typename QtPrivate::QEnableIf< +inline typename std::enable_if< !QtPrivate::IsQEnumHelper::Value && !QtPrivate::IsQEnumHelper >::Value, - QDebug>::Type + QDebug>::type qt_QMetaEnum_flagDebugOperator_helper(QDebug debug, const QFlags &flags) #else // !QT_NO_QOBJECT && !Q_QDOC template @@ -402,7 +402,7 @@ template inline QDebug operator<<(QDebug debug, const QFlags &flags) { // We have to use an indirection otherwise specialisation of some other overload of the - // operator<< the compiler would try to instantiate QFlags for the QEnableIf + // operator<< the compiler would try to instantiate QFlags 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 - struct MetaObjectForType::Value>::Type> + struct MetaObjectForType::Value>::type> { static inline const QMetaObject *value() { return &T::staticMetaObject; } }; template - struct MetaObjectForType::Value>::Type> + struct MetaObjectForType::Value>::type> { static inline const QMetaObject *value() { return &T::staticMetaObject; } }; template - struct MetaObjectForType::Value>::Type > + struct MetaObjectForType::Value>::type > { static inline const QMetaObject *value() { return qt_getEnumMetaObject(T()); } }; @@ -2009,7 +2009,7 @@ struct SharedPointerMetaTypeIdHelper, true> \ }; \ template \ struct MetaTypeSmartPointerHelper , \ - typename QEnableIf::Value >::Type> \ + typename std::enable_if::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 - static inline typename QtPrivate::QEnableIf::ArgumentCount) >= 0, QMetaObject::Connection>::Type + static inline typename std::enable_if::ArgumentCount) >= 0, QMetaObject::Connection>::type connect(const typename QtPrivate::FunctionPointer::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 - static inline typename QtPrivate::QEnableIf::ArgumentCount) >= 0 && - !QtPrivate::FunctionPointer::IsPointerToMemberFunction, QMetaObject::Connection>::Type + static inline typename std::enable_if::ArgumentCount) >= 0 && + !QtPrivate::FunctionPointer::IsPointerToMemberFunction, QMetaObject::Connection>::type connect(const typename QtPrivate::FunctionPointer::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type = Qt::AutoConnection) { @@ -301,7 +301,7 @@ public: //connect to a functor template - static inline typename QtPrivate::QEnableIf::ArgumentCount == -1, QMetaObject::Connection>::Type + static inline typename std::enable_if::ArgumentCount == -1, QMetaObject::Connection>::type connect(const typename QtPrivate::FunctionPointer::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 - static inline typename QtPrivate::QEnableIf::ArgumentCount == -1, QMetaObject::Connection>::Type + static inline typename std::enable_if::ArgumentCount == -1, QMetaObject::Connection>::type connect(const typename QtPrivate::FunctionPointer::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 - static inline typename QtPrivate::QEnableIf::IsPointerToMemberFunction && - !std::is_same::value, void>::Type + static inline typename std::enable_if::IsPointerToMemberFunction && + !std::is_same::value, void>::type singleShot(Duration interval, Func1 slot) { singleShot(interval, defaultTypeFor(interval), nullptr, slot); } template - static inline typename QtPrivate::QEnableIf::IsPointerToMemberFunction && - !std::is_same::value, void>::Type + static inline typename std::enable_if::IsPointerToMemberFunction && + !std::is_same::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 - static inline typename QtPrivate::QEnableIf::IsPointerToMemberFunction && - !std::is_same::value, void>::Type + static inline typename std::enable_if::IsPointerToMemberFunction && + !std::is_same::value, void>::type singleShot(Duration interval, QObject *context, Func1 slot) { singleShot(interval, defaultTypeFor(interval), context, slot); } template - static inline typename QtPrivate::QEnableIf::IsPointerToMemberFunction && - !std::is_same::value, void>::Type + static inline typename std::enable_if::IsPointerToMemberFunction && + !std::is_same::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 struct QGenericAtomicOps } template static Q_ALWAYS_INLINE - T fetchAndAndRelaxed(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndAndRelaxed(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { // implement fetchAndAnd on top of testAndSet T tmp = BaseClass::load(_q_value); @@ -294,7 +294,7 @@ template struct QGenericAtomicOps } template static Q_ALWAYS_INLINE - T fetchAndAndAcquire(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndAndAcquire(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { T tmp = BaseClass::fetchAndAndRelaxed(_q_value, operand); BaseClass::acquireMemoryFence(_q_value); @@ -302,21 +302,21 @@ template struct QGenericAtomicOps } template static Q_ALWAYS_INLINE - T fetchAndAndRelease(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndAndRelease(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::releaseMemoryFence(_q_value); return BaseClass::fetchAndAndRelaxed(_q_value, operand); } template static Q_ALWAYS_INLINE - T fetchAndAndOrdered(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndAndOrdered(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::orderedMemoryFence(_q_value); return BaseClass::fetchAndAndRelaxed(_q_value, operand); } template static Q_ALWAYS_INLINE - T fetchAndOrRelaxed(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndOrRelaxed(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { // implement fetchAndOr on top of testAndSet T tmp = BaseClass::load(_q_value); @@ -327,7 +327,7 @@ template struct QGenericAtomicOps } template static Q_ALWAYS_INLINE - T fetchAndOrAcquire(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndOrAcquire(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { T tmp = BaseClass::fetchAndOrRelaxed(_q_value, operand); BaseClass::acquireMemoryFence(_q_value); @@ -335,21 +335,21 @@ template struct QGenericAtomicOps } template static Q_ALWAYS_INLINE - T fetchAndOrRelease(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndOrRelease(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::releaseMemoryFence(_q_value); return BaseClass::fetchAndOrRelaxed(_q_value, operand); } template static Q_ALWAYS_INLINE - T fetchAndOrOrdered(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndOrOrdered(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::orderedMemoryFence(_q_value); return BaseClass::fetchAndOrRelaxed(_q_value, operand); } template static Q_ALWAYS_INLINE - T fetchAndXorRelaxed(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndXorRelaxed(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { // implement fetchAndXor on top of testAndSet T tmp = BaseClass::load(_q_value); @@ -360,7 +360,7 @@ template struct QGenericAtomicOps } template static Q_ALWAYS_INLINE - T fetchAndXorAcquire(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndXorAcquire(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { T tmp = BaseClass::fetchAndXorRelaxed(_q_value, operand); BaseClass::acquireMemoryFence(_q_value); @@ -368,14 +368,14 @@ template struct QGenericAtomicOps } template static Q_ALWAYS_INLINE - T fetchAndXorRelease(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndXorRelease(T &_q_value, typename std::enable_if::isIntegral, T>::type operand) Q_DECL_NOTHROW { BaseClass::releaseMemoryFence(_q_value); return BaseClass::fetchAndXorRelaxed(_q_value, operand); } template static Q_ALWAYS_INLINE - T fetchAndXorOrdered(T &_q_value, typename QtPrivate::QEnableIf::isIntegral, T>::Type operand) Q_DECL_NOTHROW + T fetchAndXorOrdered(T &_q_value, typename std::enable_if::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 -static typename QtPrivate::QEnableIf::isIntegral, Qt::HANDLE>::Type to_HANDLE(T id) +static typename std::enable_if::isIntegral, Qt::HANDLE>::type to_HANDLE(T id) { return reinterpret_cast(static_cast(id)); } template -static typename QtPrivate::QEnableIf::isIntegral, T>::Type from_HANDLE(Qt::HANDLE id) +static typename std::enable_if::isIntegral, T>::type from_HANDLE(Qt::HANDLE id) { return static_cast(reinterpret_cast(id)); } template -static typename QtPrivate::QEnableIf::isPointer, Qt::HANDLE>::Type to_HANDLE(T id) +static typename std::enable_if::isPointer, Qt::HANDLE>::type to_HANDLE(T id) { return id; } template -static typename QtPrivate::QEnableIf::isPointer, T>::Type from_HANDLE(Qt::HANDLE id) +static typename std::enable_if::isPointer, T>::type from_HANDLE(Qt::HANDLE id) { return static_cast(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 struct QArrayOpsSelector::isComplex && !QTypeInfo::isStatic - >::Type> + >::type> { typedef QPodArrayOps Type; }; template struct QArrayOpsSelector::isComplex && !QTypeInfo::isStatic - >::Type> + >::type> { typedef QMovableArrayOps 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 - static typename QtPrivate::QEnableIf::isComplex>::Type + static typename std::enable_if::isComplex>::type callDestructorIfNecessary(T &t) Q_DECL_NOTHROW { Q_UNUSED(t); t.~T(); } // Q_UNUSED: silence MSVC unused 't' warning template - static typename QtPrivate::QEnableIf::isComplex>::Type + static typename std::enable_if::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 &src) } template -QWeakPointer::Value, T>::Type> +QWeakPointer::Value, T>::type> qWeakPointerFromVariant(const QVariant &variant) { return QWeakPointer(qobject_cast(QtSharedPointer::weakPointerFromVariant_internal(variant).data())); } template -QSharedPointer::Value, T>::Type> +QSharedPointer::Value, T>::type> qSharedPointerFromVariant(const QVariant &variant) { return qSharedPointerObjectCast(QtSharedPointer::sharedPointerFromVariant_internal(variant)); diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h index 46c7ae5c55..4d1d8e1eb1 100644 --- a/src/network/socket/qnativesocketengine_p.h +++ b/src/network/socket/qnativesocketengine_p.h @@ -108,9 +108,9 @@ union qt_sockaddr { namespace { namespace SetSALen { - template void set(T *sa, typename QtPrivate::QEnableIf<(&T::sa_len, true), QT_SOCKLEN_T>::Type len) + template void set(T *sa, typename std::enable_if<(&T::sa_len, true), QT_SOCKLEN_T>::type len) { sa->sa_len = len; } - template void set(T *sin6, typename QtPrivate::QEnableIf<(&T::sin6_len, true), QT_SOCKLEN_T>::Type len) + template void set(T *sin6, typename std::enable_if<(&T::sin6_len, true), QT_SOCKLEN_T>::type len) { sin6->sin6_len = len; } template void set(T *, ...) {} } diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 058c0b3295..66f2b7c3c2 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -240,14 +240,14 @@ namespace QTest namespace Internal { template // Output registered enums - inline typename QtPrivate::QEnableIf::Value, char*>::Type toString(T e) + inline typename std::enable_if::Value, char*>::type toString(T e) { QMetaEnum me = QMetaEnum::fromType(); return qstrdup(me.valueToKey(int(e))); // int cast is necessary to support enum classes } template // Fallback - inline typename QtPrivate::QEnableIf::Value, char*>::Type toString(const T &) + inline typename std::enable_if::Value, char*>::type toString(const T &) { return Q_NULLPTR; } diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h index 5d218ac1ba..e9a5db1112 100644 --- a/src/widgets/widgets/qmenu.h +++ b/src/widgets/widgets/qmenu.h @@ -98,8 +98,8 @@ public: #else // addAction(QString): Connect to a QObject slot / functor or function pointer (with context) template - inline typename QtPrivate::QEnableIf::value - && QtPrivate::IsPointerToTypeDerivedFromQObject::Value, QAction *>::Type + inline typename std::enable_if::value + && QtPrivate::IsPointerToTypeDerivedFromQObject::Value, QAction *>::type addAction(const QString &text, const Obj *object, Func1 slot, const QKeySequence &shortcut = 0) { QAction *result = addAction(text); @@ -126,8 +126,8 @@ public: } // addAction(QIcon, QString): Connect to a QObject slot / functor or function pointer (with context) template - inline typename QtPrivate::QEnableIf::value - && QtPrivate::IsPointerToTypeDerivedFromQObject::Value, QAction *>::Type + inline typename std::enable_if::value + && QtPrivate::IsPointerToTypeDerivedFromQObject::Value, QAction *>::type addAction(const QIcon &actionIcon, const QString &text, const Obj *object, Func1 slot, const QKeySequence &shortcut = 0) { QAction *result = addAction(actionIcon, text); diff --git a/src/widgets/widgets/qtoolbar.h b/src/widgets/widgets/qtoolbar.h index 0ea4d4afeb..e0f2d9b073 100644 --- a/src/widgets/widgets/qtoolbar.h +++ b/src/widgets/widgets/qtoolbar.h @@ -116,8 +116,8 @@ public: #else // addAction(QString): Connect to a QObject slot / functor or function pointer (with context) template - inline typename QtPrivate::QEnableIf::value - && QtPrivate::IsPointerToTypeDerivedFromQObject::Value, QAction *>::Type + inline typename std::enable_if::value + && QtPrivate::IsPointerToTypeDerivedFromQObject::Value, QAction *>::type addAction(const QString &text, const Obj *object, Func1 slot) { QAction *result = addAction(text); @@ -134,8 +134,8 @@ public: } // addAction(QString): Connect to a QObject slot / functor or function pointer (with context) template - inline typename QtPrivate::QEnableIf::value - && QtPrivate::IsPointerToTypeDerivedFromQObject::Value, QAction *>::Type + inline typename std::enable_if::value + && QtPrivate::IsPointerToTypeDerivedFromQObject::Value, QAction *>::type addAction(const QIcon &actionIcon, const QString &text, const Obj *object, Func1 slot) { QAction *result = addAction(actionIcon, text); -- cgit v1.2.3