Compare commits

..

3 Commits

Author SHA1 Message Date
Chris Cranford 04c46ac573
Merge ab3db91c92 into 0ddef6ed96 2024-01-15 23:41:37 +00:00
Chris Cranford ab3db91c92 Add pure virtual test 2024-01-15 18:41:03 -05:00
Chris Cranford 321c8d2b30 Rework GDCLASS macro to allow pure virtual functions 2024-01-15 18:40:58 -05:00
1 changed files with 11 additions and 3 deletions

View File

@ -152,12 +152,20 @@ template <class T>
class ClassCreator {
public:
static GDExtensionObjectPtr create(void *data) {
T *new_object = memnew(T);
return new_object->_owner;
if constexpr (!std::is_abstract_v<T>) {
T *new_object = memnew(T);
return new_object->_owner;
} else {
return nullptr;
}
};
static GDExtensionClassInstancePtr recreate(void *data, GDExtensionObjectPtr obj) {
_GDCLASS_RECREATE(T)
if constexpr (!std::is_abstract_v<T>) {
_GDCLASS_RECREATE(T)
} else {
return nullptr;
}
}
};