From 68f8a63e8f8ae983de95322e1db8deec25a8df95 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Tue, 6 Aug 2024 10:26:51 +0800 Subject: [PATCH] Make member function const --- lsplant/src/main/jni/include/utils/hook_helper.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lsplant/src/main/jni/include/utils/hook_helper.hpp b/lsplant/src/main/jni/include/utils/hook_helper.hpp index 935aa8110..09f83c684 100644 --- a/lsplant/src/main/jni/include/utils/hook_helper.hpp +++ b/lsplant/src/main/jni/include/utils/hook_helper.hpp @@ -49,7 +49,7 @@ template requires(std::is_same_v || std::is_same_v) inline auto memfun_cast(Return (*func)(T *, Args...)) { union { - Return (Class::*f)(Args...); + Return (Class::*f)(Args...) const; struct { decltype(func) p; @@ -145,7 +145,7 @@ struct MemberFunction { private: friend struct HookHandler; using ThisType = std::conditional_t, MemberFunction, This>; - Ret (ThisType::*function_)(Args...) = nullptr; + Ret (ThisType::*function_)(Args...) const = nullptr; }; template