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

View file

@ -28,7 +28,7 @@ namespace geode::addresser {
inline F rthunkAdjust(T func, F self);
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();
}