diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2017-09-13 22:47:21 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-09-13 22:47:21 +0000 |
| commit | 56c22732c65aac3f1958df559ae16ab4b4e64a0a (patch) | |
| tree | 88f683d9b30a68df177c639f3312a083eca97c3f /libutils | |
| parent | 6818f80dbb19ce30e2ed95bdc13f8c089660f627 (diff) | |
| parent | 28ebfe18fb846ae034e3a45421d9d28c1c5f70db (diff) | |
| download | system_core-56c22732c65aac3f1958df559ae16ab4b4e64a0a.tar.gz system_core-56c22732c65aac3f1958df559ae16ab4b4e64a0a.tar.bz2 system_core-56c22732c65aac3f1958df559ae16ab4b4e64a0a.zip | |
Merge "Add "operator bool" overload to android::sp."
am: 28ebfe18fb
Change-Id: Idc8a68835c6a13ab92ffce44507360c2d8e6d9e5
Diffstat (limited to 'libutils')
| -rw-r--r-- | libutils/include/utils/StrongPointer.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libutils/include/utils/StrongPointer.h b/libutils/include/utils/StrongPointer.h index 0c2060791..ae6d9c82e 100644 --- a/libutils/include/utils/StrongPointer.h +++ b/libutils/include/utils/StrongPointer.h @@ -82,9 +82,10 @@ public: // Accessors - inline T& operator* () const { return *m_ptr; } - inline T* operator-> () const { return m_ptr; } - inline T* get() const { return m_ptr; } + inline T& operator* () const { return *m_ptr; } + inline T* operator-> () const { return m_ptr; } + inline T* get() const { return m_ptr; } + inline explicit operator bool () const { return m_ptr != nullptr; } // Operators |
