diff --git a/src/base_object-inl.h b/src/base_object-inl.h index b3fb1562707b64..555063f4e23e67 100644 --- a/src/base_object-inl.h +++ b/src/base_object-inl.h @@ -338,6 +338,20 @@ BaseObjectPtrImpl::operator bool() const { return get() != nullptr; } +template +template +bool BaseObjectPtrImpl::operator ==( + const BaseObjectPtrImpl& other) const { + return get() == other.get(); +} + +template +template +bool BaseObjectPtrImpl::operator !=( + const BaseObjectPtrImpl& other) const { + return get() != other.get(); +} + template BaseObjectPtr MakeBaseObject(Args&&... args) { return BaseObjectPtr(new T(std::forward(args)...)); diff --git a/src/base_object.h b/src/base_object.h index 39450540323a6c..79ef76b236f549 100644 --- a/src/base_object.h +++ b/src/base_object.h @@ -236,6 +236,11 @@ class BaseObjectPtrImpl final { inline T* operator->() const; inline operator bool() const; + template + inline bool operator ==(const BaseObjectPtrImpl& other) const; + template + inline bool operator !=(const BaseObjectPtrImpl& other) const; + private: union { BaseObject* target; // Used for strong pointers.