From 22e7bfac5479cf1b323aa77cf16abd0ac8329685 Mon Sep 17 00:00:00 2001 From: Curve Date: Mon, 25 Dec 2023 19:51:01 +0100 Subject: [PATCH] refactor(hook): return hook pointer for lambdas --- include/lime/hooks/hook.hpp | 23 +++++------------------ include/lime/hooks/hook.inl | 35 ++++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/include/lime/hooks/hook.hpp b/include/lime/hooks/hook.hpp index 94bc620..d5af056 100644 --- a/include/lime/hooks/hook.hpp +++ b/include/lime/hooks/hook.hpp @@ -4,9 +4,7 @@ #include #include -#include #include -#include namespace lime { @@ -47,19 +45,7 @@ namespace lime concept Address = requires() { requires std::integral || std::is_pointer_v; }; template - consteval auto lambda_target() - { - using args_t = boost::callable_traits::args_t; - using rtn_t = boost::callable_traits::return_type_t; - - return std::apply( - [](T &&...) - { - using func_t = std::function; - return std::type_identity{}; - }, - args_t{}); - } + consteval auto lambda_target(); template using lambda_target_t = typename decltype(lambda_target())::type; @@ -67,19 +53,20 @@ namespace lime template class hook : public hook_base { + template