FunctionTraitsHelper: Remove useless template specialization

The generic version works the same way as the zero arguments
specialization except for out-of-bound argument access.

Out-of-bound argument access was only used by tst_qhttpserverrouter
and is removed by this commit.

Task-number: QTBUG-100868
Pick-to: 6.4
Change-Id: I49b8d7623ed758b34f9726a497f86333d6002242
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Ievgenii Meshcheriakov 2022-06-29 15:57:10 +02:00
parent d49edbd667
commit 398aa128c2
2 changed files with 0 additions and 59 deletions

View File

@ -36,22 +36,6 @@ struct FunctionTraitsHelper
};
};
template<bool classMember, typename ReturnT>
struct FunctionTraitsHelper<classMember, ReturnT>
{
static constexpr const int ArgumentCount = 0;
static constexpr const int ArgumentIndexMax = -1;
static constexpr const bool IsClassMember = classMember;
using ReturnType = ReturnT;
template <int I>
struct Arg {
using Type = std::false_type;
using CleanType = Type;
static constexpr bool Defined = QMetaTypeId2<CleanType>::Defined;
};
};
template<typename T>
struct FunctionTraits;

View File

@ -207,49 +207,6 @@ void tst_QHttpServerRouter::viewHandlerNoArg()
static_assert(Args::PlaceholdersCount == 0,
"viewNonArg: Args::PlaceholdersCount == 0");
static_assert(Args::Last::IsRequest::Value == 0,
"viewNonArg: Args::Last::IsRequest::Value == 0");
static_assert(Args::Last::IsRequest::Valid == 0,
"viewNonArg: Args::Last::IsRequest::Valid == 0");
static_assert(Args::Last::IsResponder::Value == 0,
"viewNonArg: Args::Last::IsResponder::Value == 0");
static_assert(Args::Last::IsResponder::Valid == 0,
"viewNonArg: Args::Last::IsResponder::Valid == 0");
static_assert(Args::Last::IsSpecial::Value == 0,
"viewNonArg: Args::Last::IsSpecial::Value == 0");
static_assert(Args::Last::IsSpecial::Valid == 0,
"viewNonArg: Args::Last::IsSpecial::Valid == 0");
static_assert(Args::Last::IsSimple::Value == 0,
"viewNonArg: Args::Last::IsSimple::Value == 0");
static_assert(Args::Last::IsSimple::Valid == 0,
"viewNonArg: Args::Last::IsSimple::Valid == 0");
static_assert(Args::Last::Valid == 0,
"viewOneArg: Args::Last::Valid");
static_assert(Args::Last::StaticAssert,
"viewOneArg: Args::Last::StaticAssert");
static_assert(std::is_same<Args::Last::Type, std::false_type>::value,
"viewNonArg: std::is_same<Args::Last::Type, std::false_type>");
using Arg1 = typename Args::template Arg<1>;
static_assert(Arg1::IsRequest::Value == 0,
"viewNonArg: Args::Arg<1>::isRequest::Value == 0");
static_assert(Arg1::IsRequest::Valid == 0,
"viewNonArg: Args::Arg<1>::IsRequest::Valid == 0");
static_assert(Arg1::IsResponder::Value == 0,
"viewNonArg: Args::Arg<1>::IsResponder::Value == 0");
static_assert(Arg1::IsResponder::Valid == 0,
"viewNonArg: Args::Arg<1>::IsResponder::Valid == 0");
static_assert(Arg1::IsSpecial::Value == 0,
"viewNonArg: Args::Arg<1>::IsSpecial::Value == 0");
static_assert(Arg1::IsSpecial::Valid == 0,
"viewNonArg: Args::Arg<1>::IsSpecial::Valid == 0");
static_assert(Arg1::Valid == 0,
"viewOneArg: Args::Arg<1>::Valid");
static_assert(Arg1::StaticAssert,
"viewOneArg: Args::Arg<1>::Valid::StaticAssert");
static_assert(std::is_same<Arg1::Type, std::false_type>::value,
"viewNonArg: std::is_same<Args::Arg<1>::Type, std::false_type>");
static_assert(Args::Valid, "viewNonArg: Args::Valid");
static_assert(Args::StaticAssert, "viewNonArg: Args::StaticAssert");
}