#ifndef GEODE_CORE_META_FUNCTION_HPP #define GEODE_CORE_META_FUNCTION_HPP #include "callconv.hpp" #include "common.hpp" #include "tuple.hpp" #include namespace geode::core::meta { /* The Geode Function class wraps functions with unconventional * calling conventions (how ironic). */ template class Conv> class Function { static_assert(always_false, "Not a valid function pointer!"); }; template class Conv> class Function { private: using MyConv = Conv; private: void* addr; public: template Function(const Pointer& addr) : addr(reinterpret_cast(addr)) {} decltype(auto) operator()(Args... all) const { return MyConv::invoke(addr, all...); } }; } #endif /* GEODE_CORE_META_FUNCTION_HPP */