diff --git a/src/base_object-inl.h b/src/base_object-inl.h index 5dad438d1f55bf..cee7976c37e004 100644 --- a/src/base_object-inl.h +++ b/src/base_object-inl.h @@ -336,6 +336,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 cc7a220d078552..24965a9879825d 100644 --- a/src/base_object.h +++ b/src/base_object.h @@ -195,6 +195,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.