We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb68487 commit 19b55beCopy full SHA for 19b55be
2 files changed
src/base_object-inl.h
@@ -336,6 +336,20 @@ BaseObjectPtrImpl<T, kIsWeak>::operator bool() const {
336
return get() != nullptr;
337
}
338
339
+template <typename T, bool kIsWeak>
340
+template <typename U, bool kW>
341
+bool BaseObjectPtrImpl<T, kIsWeak>::operator ==(
342
+ const BaseObjectPtrImpl<U, kW>& other) const {
343
+ return get() == other.get();
344
+}
345
+
346
347
348
+bool BaseObjectPtrImpl<T, kIsWeak>::operator !=(
349
350
+ return get() != other.get();
351
352
353
template <typename T, typename... Args>
354
BaseObjectPtr<T> MakeBaseObject(Args&&... args) {
355
return BaseObjectPtr<T>(new T(std::forward<Args>(args)...));
src/base_object.h
@@ -195,6 +195,11 @@ class BaseObjectPtrImpl final {
195
inline T* operator->() const;
196
inline operator bool() const;
197
198
+ template <typename U, bool kW>
199
+ inline bool operator ==(const BaseObjectPtrImpl<U, kW>& other) const;
200
201
+ inline bool operator !=(const BaseObjectPtrImpl<U, kW>& other) const;
202
203
private:
204
union {
205
BaseObject* target; // Used for strong pointers.
0 commit comments