summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2015-11-07 12:32:42 +0100
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2015-11-16 19:07:56 +0000
commit1e30be700a2602db2d439df2b70fc6b4727ac3fa (patch)
treedf9b9a50371ad17e0365caed1f2f056cc4887984 /src/corelib/kernel
parent26eb4b35898f8578e3f7259afe9c76307c46b79b (diff)
qobject.h: remove hack that simulated decltype
In order to know the type of the arguments of a functor with compilers not having decltype, it was simulated with an intermediary function. Now that decltype is mandatory, we can remove this hack Change-Id: I7eb283943abeeb4ef1c62358da89b0ede70b3ef5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qobject.h10
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h2
2 files changed, 2 insertions, 10 deletions
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 64c5b58fd4..118316484b 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -293,7 +293,7 @@ public:
connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,
Qt::ConnectionType type = Qt::AutoConnection)
{
-#if defined (Q_COMPILER_DECLTYPE) && defined (Q_COMPILER_VARIADIC_TEMPLATES)
+#if defined (Q_COMPILER_VARIADIC_TEMPLATES)
typedef QtPrivate::FunctionPointer<Func1> SignalType;
const int FunctorArgumentCount = QtPrivate::ComputeFunctorArgumentCount<Func2 , typename SignalType::Arguments>::Value;
@@ -313,15 +313,7 @@ public:
Functors with overloaded or templated operator() are only supported if the compiler supports
C++11 variadic templates
*/
-#ifndef Q_COMPILER_DECLTYPE //Workaround the lack of decltype using another function as indirection
- return connect_functor(sender, signal, context, slot, &Func2::operator(), type); }
- template <typename Func1, typename Func2, typename Func2Operator>
- static inline QMetaObject::Connection connect_functor(const QObject *sender, Func1 signal, const QObject *context,
- Func2 slot, Func2Operator, Qt::ConnectionType type) {
- typedef QtPrivate::FunctionPointer<Func2Operator> SlotType ;
-#else
typedef QtPrivate::FunctionPointer<decltype(&Func2::operator())> SlotType ;
-#endif
typedef QtPrivate::FunctionPointer<Func1> SignalType;
typedef typename SlotType::ReturnType SlotReturnType;
const int SlotArgumentCount = SlotType::ArgumentCount;
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index d5574a4dd1..dc445a426d 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -593,7 +593,7 @@ namespace QtPrivate {
};
#endif
-#if defined(Q_COMPILER_DECLTYPE) && defined(Q_COMPILER_VARIADIC_TEMPLATES)
+#if defined(Q_COMPILER_VARIADIC_TEMPLATES)
/*
Find the maximum number of arguments a functor object can take and be still compatible with
the arguments from the signal.