fix create overloads not recognising

This commit is contained in:
altalk23 2023-01-30 11:07:18 +03:00
parent 4aa09c085b
commit 63e9b4c5f7
2 changed files with 4 additions and 6 deletions

View file

@ -137,8 +137,7 @@ namespace geode {
namespace addresser { namespace addresser {
template <class Class> template <class Class>
Class* friendCreate(typename std::enable_if_t< Class* friendCreate(typename std::void_t<decltype(static_cast<Class* (*)()>(&Class::create))>*);
std::is_same_v<decltype(&Class::create), Class* (*)()>>*);
} }
} }
@ -151,9 +150,8 @@ namespace geode {
friend geode::Result<tulip::hook::HandlerMetadata, std::string> \ friend geode::Result<tulip::hook::HandlerMetadata, std::string> \
geode::modifier::handlerMetadataForAddress(uintptr_t address); \ geode::modifier::handlerMetadataForAddress(uintptr_t address); \
template <class Class> \ template <class Class> \
friend Class* \ friend Class* geode::addresser:: \
geode::addresser::friendCreate(typename std::enable_if_t< \ friendCreate(typename std::void_t<decltype(static_cast<Class* (*)()>(&Class::create))>*);
std::is_same_v<decltype(&Class::create), Class* (*)()>>*);
#define GEODE_ADD(...) __VA_ARGS__ #define GEODE_ADD(...) __VA_ARGS__

View file

@ -28,7 +28,7 @@ namespace geode::addresser {
inline F rthunkAdjust(T func, F self); inline F rthunkAdjust(T func, F self);
template <class Class> template <class Class>
Class* friendCreate(typename std::enable_if_t<std::is_same_v<decltype(&Class::create), Class* (*)()>>*) { Class* friendCreate(typename std::void_t<decltype(static_cast<Class* (*)()>(&Class::create))>*) {
return Class::create(); return Class::create();
} }