summaryrefslogtreecommitdiff
path: root/core/ref_ptr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/ref_ptr.cpp')
-rw-r--r--core/ref_ptr.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/ref_ptr.cpp b/core/ref_ptr.cpp
index 961f143e5c..6da73ca41a 100644
--- a/core/ref_ptr.cpp
+++ b/core/ref_ptr.cpp
@@ -49,6 +49,14 @@ bool RefPtr::operator==(const RefPtr &p_other) const {
return *ref == *ref_other;
}
+bool RefPtr::operator!=(const RefPtr &p_other) const {
+
+ Ref<Reference> *ref = reinterpret_cast<Ref<Reference> *>(&data[0]);
+ Ref<Reference> *ref_other = reinterpret_cast<Ref<Reference> *>(const_cast<char *>(&p_other.data[0]));
+
+ return *ref != *ref_other;
+}
+
RefPtr::RefPtr(const RefPtr &p_other) {
memnew_placement(&data[0], Ref<Reference>);