util/BindMethod: add MethodSignatureHelper::function_pointer

This commit is contained in:
Max Kellermann 2021-12-02 23:24:51 +01:00 committed by Max Kellermann
parent 172c4d9c7d
commit 7e4ba3cb72

View File

@ -119,6 +119,9 @@ struct MethodSignatureHelper<R (T::*)(Args...) noexcept(NoExcept)> {
* signature.
*/
typedef R plain_signature(Args...) noexcept(NoExcept);
typedef R (*function_pointer)(void *instance,
Args...) noexcept(NoExcept);
};
/**
@ -152,7 +155,7 @@ struct BindMethodWrapperGenerator<R (T::*)(Args...) noexcept(NoExcept), method>
};
template<auto method>
typename MethodWrapperWithSignature<typename MethodSignatureHelper<decltype(method)>::plain_signature>::function_pointer
typename MethodSignatureHelper<decltype(method)>::function_pointer
MakeBindMethodWrapper() noexcept
{
return BindMethodWrapperGenerator<decltype(method), method>::Invoke;