diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h index a6ad00ea22..8afff1fb98 100644 --- a/src/corelib/kernel/qobjectdefs_impl.h +++ b/src/corelib/kernel/qobjectdefs_impl.h @@ -112,13 +112,31 @@ namespace QtPrivate { The Functor struct is the helper to call a functor of N argument. its call function is the same as the FunctionPointer::call function. */ - template struct IndexesList {}; - template struct IndexesAppend; - template struct IndexesAppend, Right> - { typedef IndexesList Value; }; - template struct Indexes - { typedef typename IndexesAppend::Value, N - 1>::Value Value; }; - template <> struct Indexes<0> { typedef IndexesList<> Value; }; + template using InvokeGenSeq = typename T::Type; + + template struct IndexesList { using Type = IndexesList; }; + + template struct ConcatSeqImpl; + + template + struct ConcatSeqImpl, IndexesList> + : IndexesList{}; + + template + using ConcatSeq = InvokeGenSeq>; + + template struct GenSeq; + template using makeIndexSequence = InvokeGenSeq>; + + template + struct GenSeq : ConcatSeq, makeIndexSequence>{}; + + template<> struct GenSeq<0> : IndexesList<>{}; + template<> struct GenSeq<1> : IndexesList<0>{}; + + template + struct Indexes { using Value = makeIndexSequence; }; + template struct FunctionPointer { enum {ArgumentCount = -1, IsPointerToMemberFunction = false}; }; template struct FunctorCall;