summaryrefslogtreecommitdiffstats
path: root/include/godot_cpp/classes/ref.hpp
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-04-02 14:30:01 -0500
committerGitHub <noreply@github.com>2024-04-02 14:30:01 -0500
commit44d78ec8816e57fdd0c06812d31c09a25b97d6e8 (patch)
tree502a26499fd129c80619ed290cd0125b327055f1 /include/godot_cpp/classes/ref.hpp
parenta62f633cebee4b36356dc903d00670733cd28fb1 (diff)
parent87f5fb06912d19b3ff3ba80b747fcea3023a1ed5 (diff)
downloadredot-cpp-44d78ec8816e57fdd0c06812d31c09a25b97d6e8.tar.gz
Merge pull request #1409 from Repiteo/class-to-typename
Enforce template syntax `typename` over `class`
Diffstat (limited to 'include/godot_cpp/classes/ref.hpp')
-rw-r--r--include/godot_cpp/classes/ref.hpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/godot_cpp/classes/ref.hpp b/include/godot_cpp/classes/ref.hpp
index f3fc3e9..c4682bc 100644
--- a/include/godot_cpp/classes/ref.hpp
+++ b/include/godot_cpp/classes/ref.hpp
@@ -45,7 +45,7 @@ namespace godot {
class RefCounted;
-template <class T>
+template <typename T>
class Ref {
T *reference = nullptr;
@@ -108,7 +108,7 @@ public:
ref(p_from);
}
- template <class T_Other>
+ template <typename T_Other>
void operator=(const Ref<T_Other> &p_from) {
RefCounted *refb = const_cast<RefCounted *>(static_cast<const RefCounted *>(p_from.ptr()));
if (!refb) {
@@ -144,7 +144,7 @@ public:
}
}
- template <class T_Other>
+ template <typename T_Other>
void reference_ptr(T_Other *p_ptr) {
if (reference == p_ptr) {
return;
@@ -161,7 +161,7 @@ public:
ref(p_from);
}
- template <class T_Other>
+ template <typename T_Other>
Ref(const Ref<T_Other> &p_from) {
RefCounted *refb = const_cast<RefCounted *>(static_cast<const RefCounted *>(p_from.ptr()));
if (!refb) {
@@ -226,7 +226,7 @@ public:
}
};
-template <class T>
+template <typename T>
struct PtrToArg<Ref<T>> {
_FORCE_INLINE_ static Ref<T> convert(const void *p_ptr) {
GDExtensionRefPtr ref = (GDExtensionRefPtr)p_ptr;
@@ -248,7 +248,7 @@ struct PtrToArg<Ref<T>> {
}
};
-template <class T>
+template <typename T>
struct PtrToArg<const Ref<T> &> {
typedef Ref<T> EncodeT;
@@ -259,7 +259,7 @@ struct PtrToArg<const Ref<T> &> {
}
};
-template <class T>
+template <typename T>
struct GetTypeInfo<Ref<T>, typename EnableIf<TypeInherits<RefCounted, T>::value>::type> {
static const GDExtensionVariantType VARIANT_TYPE = GDEXTENSION_VARIANT_TYPE_OBJECT;
static const GDExtensionClassMethodArgumentMetadata METADATA = GDEXTENSION_METHOD_ARGUMENT_METADATA_NONE;
@@ -269,7 +269,7 @@ struct GetTypeInfo<Ref<T>, typename EnableIf<TypeInherits<RefCounted, T>::value>
}
};
-template <class T>
+template <typename T>
struct GetTypeInfo<const Ref<T> &, typename EnableIf<TypeInherits<RefCounted, T>::value>::type> {
static const GDExtensionVariantType VARIANT_TYPE = GDEXTENSION_VARIANT_TYPE_OBJECT;
static const GDExtensionClassMethodArgumentMetadata METADATA = GDEXTENSION_METHOD_ARGUMENT_METADATA_NONE;