Skip to content

Commit

Permalink
Make member function const
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Aug 6, 2024
1 parent 14b753e commit 68f8a63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lsplant/src/main/jni/include/utils/hook_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ template <typename Class, typename Return, typename T, typename... Args>
requires(std::is_same_v<T, void> || std::is_same_v<Class, T>)
inline auto memfun_cast(Return (*func)(T *, Args...)) {
union {
Return (Class::*f)(Args...);
Return (Class::*f)(Args...) const;

struct {
decltype(func) p;
Expand Down Expand Up @@ -145,7 +145,7 @@ struct MemberFunction<Sym, This, Ret(Args...)> {
private:
friend struct HookHandler;
using ThisType = std::conditional_t<std::is_same_v<This, void>, MemberFunction, This>;
Ret (ThisType::*function_)(Args...) = nullptr;
Ret (ThisType::*function_)(Args...) const = nullptr;
};

template <FixedString Sym, typename Ret, typename... Args>
Expand Down

0 comments on commit 68f8a63

Please sign in to comment.