Inline Functor struct into FunctorCallable
It's currently its only user, so drop the extra code and inheritance. Change-Id: I6e525a9629b7289cc770133936e089683b763289 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
fd4319700f
commit
1bfdbe5c71
@ -332,21 +332,18 @@ namespace QtPrivate {
|
|||||||
typedef decltype(std::declval<Functor>().operator()((std::declval<ArgList>())...)) Value;
|
typedef decltype(std::declval<Functor>().operator()((std::declval<ArgList>())...)) Value;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Function, int N> struct Functor
|
|
||||||
{
|
|
||||||
template <typename SignalArgs, typename R>
|
|
||||||
static void call(Function &f, void *, void **arg) {
|
|
||||||
FunctorCall<typename Indexes<N>::Value, SignalArgs, R, Function>::call(f, arg);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename Func, typename... Args>
|
template<typename Func, typename... Args>
|
||||||
struct FunctorCallable : Functor<Func, sizeof...(Args)>
|
struct FunctorCallable
|
||||||
{
|
{
|
||||||
using ReturnType = decltype(std::declval<Func>()(std::declval<Args>()...));
|
using ReturnType = decltype(std::declval<Func>()(std::declval<Args>()...));
|
||||||
using Function = ReturnType(*)(Args...);
|
using Function = ReturnType(*)(Args...);
|
||||||
enum {ArgumentCount = sizeof...(Args)};
|
enum {ArgumentCount = sizeof...(Args)};
|
||||||
using Arguments = QtPrivate::List<Args...>;
|
using Arguments = QtPrivate::List<Args...>;
|
||||||
|
|
||||||
|
template <typename SignalArgs, typename R>
|
||||||
|
static void call(Func &f, void *, void **arg) {
|
||||||
|
FunctorCall<typename Indexes<ArgumentCount>::Value, SignalArgs, R, Func>::call(f, arg);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Functor, typename... Args>
|
template <typename Functor, typename... Args>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user