#pragma once #include #include namespace geode::modifier { template struct MemberFunc { template using with = FunctionType Class::*; }; template struct ConstMemberFunc { template using with = FunctionType Class::*; }; // why template struct ConstMemberFunc { using FunctionType = Return(Parameters...) const; template using with = FunctionType Class::*; }; template struct StaticFunc { using type = FunctionType*; }; using ::geode::core::meta::always_false; /** * The ~unevaluated~ function that gets the appropriate * version of a function type from its return, parameters, and classes. * * nvm its no more unevaluated */ template constexpr auto substitute(typename MemberFunc::template with function) { return function; } template constexpr auto substitute(typename ConstMemberFunc::template with function ) { return function; } template constexpr auto substitute(typename StaticFunc::type function) { return function; } /** * An UUID system that generates an unique comparable * value for every instance. Internally used for comparing member * function pointers. */ template struct FunctionUUID { private: constexpr static void function() {} public: constexpr static inline void (*value)() = &FunctionUUID::function; }; }