Commit bd5f6cbc authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

util/BindMethod: simplify more templates using "auto" template arguments

parent 6fcd1c73
...@@ -191,11 +191,11 @@ struct FunctionTraits<R(Args...) noexcept(NoExcept)> { ...@@ -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 ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment