util/BindMethod: simplify more templates using "auto" template arguments
This commit is contained in:
parent
6fcd1c734b
commit
bd5f6cbc7b
@ -191,11 +191,11 @@ struct FunctionTraits<R(Args...) noexcept(NoExcept)> {
|
|||||||
* @param P the plain function pointer type
|
* @param P the plain function pointer type
|
||||||
* @param function the function pointer
|
* @param function the function pointer
|
||||||
*/
|
*/
|
||||||
template<typename S, typename P, P function>
|
template<typename S, auto function>
|
||||||
struct BindFunctionWrapperGenerator;
|
struct BindFunctionWrapperGenerator;
|
||||||
|
|
||||||
template<typename P, P function, bool NoExcept, typename R, typename... Args>
|
template<auto function, bool NoExcept, typename R, typename... Args>
|
||||||
struct BindFunctionWrapperGenerator<R(Args...) noexcept(NoExcept), P, function> {
|
struct BindFunctionWrapperGenerator<R(Args...) noexcept(NoExcept), function> {
|
||||||
static R Invoke(void *, Args... args) noexcept(NoExcept) {
|
static R Invoke(void *, Args... args) noexcept(NoExcept) {
|
||||||
return function(std::forward<Args>(args)...);
|
return function(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
@ -206,7 +206,6 @@ typename MethodWrapperWithSignature<typename T::function_type>::function_pointer
|
|||||||
MakeBindFunctionWrapper() noexcept
|
MakeBindFunctionWrapper() noexcept
|
||||||
{
|
{
|
||||||
return BindFunctionWrapperGenerator<typename T::function_type,
|
return BindFunctionWrapperGenerator<typename T::function_type,
|
||||||
typename T::pointer,
|
|
||||||
function>::Invoke;
|
function>::Invoke;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user