|
@@ -188,7 +188,7 @@ public:
|
|
template <class T>
|
|
template <class T>
|
|
static void register_class(bool p_virtual = false) {
|
|
static void register_class(bool p_virtual = false) {
|
|
GLOBAL_LOCK_FUNCTION;
|
|
GLOBAL_LOCK_FUNCTION;
|
|
- static_assert(TypesAreSame<typename T::self_type, T>::value, "Class not declared properly, please use GDCLASS.");
|
|
|
|
|
|
+ static_assert(types_are_same_v<typename T::self_type, T>, "Class not declared properly, please use GDCLASS.");
|
|
T::initialize_class();
|
|
T::initialize_class();
|
|
ClassInfo *t = classes.getptr(T::get_class_static());
|
|
ClassInfo *t = classes.getptr(T::get_class_static());
|
|
ERR_FAIL_NULL(t);
|
|
ERR_FAIL_NULL(t);
|
|
@@ -203,7 +203,7 @@ public:
|
|
template <class T>
|
|
template <class T>
|
|
static void register_abstract_class() {
|
|
static void register_abstract_class() {
|
|
GLOBAL_LOCK_FUNCTION;
|
|
GLOBAL_LOCK_FUNCTION;
|
|
- static_assert(TypesAreSame<typename T::self_type, T>::value, "Class not declared properly, please use GDCLASS.");
|
|
|
|
|
|
+ static_assert(types_are_same_v<typename T::self_type, T>, "Class not declared properly, please use GDCLASS.");
|
|
T::initialize_class();
|
|
T::initialize_class();
|
|
ClassInfo *t = classes.getptr(T::get_class_static());
|
|
ClassInfo *t = classes.getptr(T::get_class_static());
|
|
ERR_FAIL_NULL(t);
|
|
ERR_FAIL_NULL(t);
|
|
@@ -216,7 +216,7 @@ public:
|
|
template <class T>
|
|
template <class T>
|
|
static void register_internal_class() {
|
|
static void register_internal_class() {
|
|
GLOBAL_LOCK_FUNCTION;
|
|
GLOBAL_LOCK_FUNCTION;
|
|
- static_assert(TypesAreSame<typename T::self_type, T>::value, "Class not declared properly, please use GDCLASS.");
|
|
|
|
|
|
+ static_assert(types_are_same_v<typename T::self_type, T>, "Class not declared properly, please use GDCLASS.");
|
|
T::initialize_class();
|
|
T::initialize_class();
|
|
ClassInfo *t = classes.getptr(T::get_class_static());
|
|
ClassInfo *t = classes.getptr(T::get_class_static());
|
|
ERR_FAIL_NULL(t);
|
|
ERR_FAIL_NULL(t);
|
|
@@ -239,7 +239,7 @@ public:
|
|
template <class T>
|
|
template <class T>
|
|
static void register_custom_instance_class() {
|
|
static void register_custom_instance_class() {
|
|
GLOBAL_LOCK_FUNCTION;
|
|
GLOBAL_LOCK_FUNCTION;
|
|
- static_assert(TypesAreSame<typename T::self_type, T>::value, "Class not declared properly, please use GDCLASS.");
|
|
|
|
|
|
+ static_assert(types_are_same_v<typename T::self_type, T>, "Class not declared properly, please use GDCLASS.");
|
|
T::initialize_class();
|
|
T::initialize_class();
|
|
ClassInfo *t = classes.getptr(T::get_class_static());
|
|
ClassInfo *t = classes.getptr(T::get_class_static());
|
|
ERR_FAIL_NULL(t);
|
|
ERR_FAIL_NULL(t);
|
|
@@ -296,7 +296,7 @@ public:
|
|
argptrs[i] = &args[i];
|
|
argptrs[i] = &args[i];
|
|
}
|
|
}
|
|
MethodBind *bind = create_method_bind(p_method);
|
|
MethodBind *bind = create_method_bind(p_method);
|
|
- if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) {
|
|
|
|
|
|
+ if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) {
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
}
|
|
}
|
|
return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, false, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args));
|
|
return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, false, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args));
|
|
@@ -311,7 +311,7 @@ public:
|
|
}
|
|
}
|
|
MethodBind *bind = create_static_method_bind(p_method);
|
|
MethodBind *bind = create_static_method_bind(p_method);
|
|
bind->set_instance_class(p_class);
|
|
bind->set_instance_class(p_class);
|
|
- if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) {
|
|
|
|
|
|
+ if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) {
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
}
|
|
}
|
|
return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, false, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args));
|
|
return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, false, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args));
|
|
@@ -325,7 +325,7 @@ public:
|
|
argptrs[i] = &args[i];
|
|
argptrs[i] = &args[i];
|
|
}
|
|
}
|
|
MethodBind *bind = create_method_bind(p_method);
|
|
MethodBind *bind = create_method_bind(p_method);
|
|
- if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) {
|
|
|
|
|
|
+ if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) {
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
}
|
|
}
|
|
return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, true, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args));
|
|
return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, true, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args));
|
|
@@ -340,7 +340,7 @@ public:
|
|
}
|
|
}
|
|
MethodBind *bind = create_static_method_bind(p_method);
|
|
MethodBind *bind = create_static_method_bind(p_method);
|
|
bind->set_instance_class(p_class);
|
|
bind->set_instance_class(p_class);
|
|
- if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) {
|
|
|
|
|
|
+ if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) {
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
}
|
|
}
|
|
return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, true, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args));
|
|
return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, true, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args));
|
|
@@ -353,7 +353,7 @@ public:
|
|
MethodBind *bind = create_vararg_method_bind(p_method, p_info, p_return_nil_is_variant);
|
|
MethodBind *bind = create_vararg_method_bind(p_method, p_info, p_return_nil_is_variant);
|
|
ERR_FAIL_NULL_V(bind, nullptr);
|
|
ERR_FAIL_NULL_V(bind, nullptr);
|
|
|
|
|
|
- if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) {
|
|
|
|
|
|
+ if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) {
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
}
|
|
}
|
|
return _bind_vararg_method(bind, p_name, p_default_args, false);
|
|
return _bind_vararg_method(bind, p_name, p_default_args, false);
|
|
@@ -366,7 +366,7 @@ public:
|
|
MethodBind *bind = create_vararg_method_bind(p_method, p_info, p_return_nil_is_variant);
|
|
MethodBind *bind = create_vararg_method_bind(p_method, p_info, p_return_nil_is_variant);
|
|
ERR_FAIL_NULL_V(bind, nullptr);
|
|
ERR_FAIL_NULL_V(bind, nullptr);
|
|
|
|
|
|
- if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) {
|
|
|
|
|
|
+ if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) {
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
bind->set_return_type_is_raw_object_ptr(true);
|
|
}
|
|
}
|
|
return _bind_vararg_method(bind, p_name, p_default_args, true);
|
|
return _bind_vararg_method(bind, p_name, p_default_args, true);
|