summaryrefslogtreecommitdiff
path: root/core/fxcrt/observable.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/observable.h')
-rw-r--r--core/fxcrt/observable.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fxcrt/observable.h b/core/fxcrt/observable.h
index e118dc898b..3205bc09df 100644
--- a/core/fxcrt/observable.h
+++ b/core/fxcrt/observable.h
@@ -46,6 +46,7 @@ class Observable {
ASSERT(m_pObservable);
m_pObservable = nullptr;
}
+ bool HasObservable() const { return !!m_pObservable; }
ObservedPtr& operator=(const ObservedPtr& that) {
Reset(that.Get());
return *this;
@@ -54,7 +55,7 @@ class Observable {
return m_pObservable == that.m_pObservable;
}
bool operator!=(const ObservedPtr& that) const { return !(*this == that); }
- explicit operator bool() const { return !!m_pObservable; }
+ explicit operator bool() const { return HasObservable(); }
T* Get() const { return m_pObservable; }
T& operator*() const { return *m_pObservable; }
T* operator->() const { return m_pObservable; }