diff --git a/src/util/BindMethod.hxx b/src/util/BindMethod.hxx index 12fa7356a..544f735c8 100644 --- a/src/util/BindMethod.hxx +++ b/src/util/BindMethod.hxx @@ -82,15 +82,15 @@ public: namespace BindMethodDetail { /** - * Helper class which introspects a method pointer type. + * Helper class which introspects a method/function pointer type. * - * @param M the method pointer type + * @param M the method/function pointer type */ template -struct MethodSignatureHelper; +struct SignatureHelper; template -struct MethodSignatureHelper { +struct SignatureHelper { /** * The class which contains the given method (signature). */ @@ -106,15 +106,8 @@ struct MethodSignatureHelper { Args...) noexcept(NoExcept); }; -/** - * Helper class which converts a function pointer to a wrapper - * function pointer type. - */ -template -struct FunctionSignatureHelper; - template -struct FunctionSignatureHelper { +struct SignatureHelper { typedef R plain_signature(Args...) noexcept(NoExcept); typedef R (*function_pointer)(void *instance, @@ -146,14 +139,14 @@ struct WrapperGenerator { }; template -typename MethodSignatureHelper::function_pointer +typename SignatureHelper::function_pointer MakeBindMethodWrapper() noexcept { return WrapperGenerator::Invoke; } template -typename FunctionSignatureHelper::function_pointer +typename SignatureHelper::function_pointer MakeBindFunctionWrapper() noexcept { return WrapperGenerator::Invoke; @@ -169,9 +162,9 @@ MakeBindFunctionWrapper() noexcept */ template constexpr auto -BindMethod(typename BindMethodDetail::MethodSignatureHelper::class_type &instance) noexcept +BindMethod(typename BindMethodDetail::SignatureHelper::class_type &instance) noexcept { - using H = BindMethodDetail::MethodSignatureHelper; + using H = BindMethodDetail::SignatureHelper; using plain_signature = typename H::plain_signature; return BoundMethod{ &instance, @@ -201,7 +194,7 @@ template constexpr auto BindFunction() noexcept { - using H = BindMethodDetail::FunctionSignatureHelper; + using H = BindMethodDetail::SignatureHelper; using plain_signature = typename H::plain_signature; return BoundMethod{ nullptr,