summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/object/ref_counted.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/object/ref_counted.h b/core/object/ref_counted.h
index 5b358135c4..f0706b4d08 100644
--- a/core/object/ref_counted.h
+++ b/core/object/ref_counted.h
@@ -86,6 +86,11 @@ public:
_FORCE_INLINE_ bool operator!=(const T *p_ptr) const {
return reference != p_ptr;
}
+#ifdef STRICT_CHECKS
+ // Delete these to prevent raw comparisons with `nullptr`.
+ bool operator==(std::nullptr_t) const = delete;
+ bool operator!=(std::nullptr_t) const = delete;
+#endif // STRICT_CHECKS
_FORCE_INLINE_ bool operator<(const Ref<T> &p_r) const {
return reference < p_r.reference;