Merge pull request #21250 from dragmz/ref-ptr-n(eq)-op
== and != operators for Ref<T> / T*
This commit is contained in:
commit
65c8a49122
2 changed files with 8 additions and 1 deletions
|
@ -87,6 +87,13 @@ class Ref {
|
||||||
|
|
||||||
//virtual Reference * get_reference() const { return reference; }
|
//virtual Reference * get_reference() const { return reference; }
|
||||||
public:
|
public:
|
||||||
|
_FORCE_INLINE_ bool operator==(const T *p_ptr) const {
|
||||||
|
return reference == p_ptr;
|
||||||
|
}
|
||||||
|
_FORCE_INLINE_ bool operator!=(const T *p_ptr) const {
|
||||||
|
return reference != p_ptr;
|
||||||
|
}
|
||||||
|
|
||||||
_FORCE_INLINE_ bool operator<(const Ref<T> &p_r) const {
|
_FORCE_INLINE_ bool operator<(const Ref<T> &p_r) const {
|
||||||
|
|
||||||
return reference < p_r.reference;
|
return reference < p_r.reference;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
void Material::set_next_pass(const Ref<Material> &p_pass) {
|
void Material::set_next_pass(const Ref<Material> &p_pass) {
|
||||||
|
|
||||||
ERR_FAIL_COND(p_pass.ptr() == this);
|
ERR_FAIL_COND(p_pass == this);
|
||||||
|
|
||||||
if (next_pass == p_pass)
|
if (next_pass == p_pass)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue