From 5aaa3f50aae52f2cf9621b8bd83c47a98dc7ac18 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 2 Oct 2023 21:49:39 +0200 Subject: [PATCH] util/BindMethod: move SignatureHelper to return type --- src/util/BindMethod.hxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/util/BindMethod.hxx b/src/util/BindMethod.hxx index d43b34948..38996030b 100644 --- a/src/util/BindMethod.hxx +++ b/src/util/BindMethod.hxx @@ -126,12 +126,10 @@ MakeWrapperFunction() noexcept * @param instance the instance of #T to be bound */ template -constexpr auto +constexpr BoundMethod::plain_signature> BindMethod(typename BindMethodDetail::SignatureHelper::class_type &instance) noexcept { - using H = BindMethodDetail::SignatureHelper; - using plain_signature = typename H::plain_signature; - return BoundMethod{ + return { &instance, BindMethodDetail::MakeWrapperFunction(), }; @@ -156,12 +154,10 @@ BindMethod(typename BindMethodDetail::SignatureHelper::class_t * @param function the function pointer */ template -constexpr auto +constexpr BoundMethod::plain_signature> BindFunction() noexcept { - using H = BindMethodDetail::SignatureHelper; - using plain_signature = typename H::plain_signature; - return BoundMethod{ + return { nullptr, BindMethodDetail::MakeWrapperFunction(), };