summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey2017-09-13 12:04:06 -0500
committerJeff Sharkey2017-09-13 12:06:07 -0500
commit147b881ca906ad3f7f1b9acf20304054df3e5ea1 (patch)
tree058a4d2d489fa50e3b3c095b5455f949e540a1e7 /libutils/include
parent2827106d7d95b5e2d41b846f1505fbfacc56d850 (diff)
downloadplatform-system-core-147b881ca906ad3f7f1b9acf20304054df3e5ea1.tar.gz
platform-system-core-147b881ca906ad3f7f1b9acf20304054df3e5ea1.tar.xz
platform-system-core-147b881ca906ad3f7f1b9acf20304054df3e5ea1.zip
Add "operator bool" overload to android::sp.
This matches the overload on std::unique_ptr and friends. Test: builds, boots Bug: 13758960 Change-Id: Ieed9faa6b162c2a10fa7cf2b135c9b17564f6c88
Diffstat (limited to 'libutils/include')
-rw-r--r--libutils/include/utils/StrongPointer.h7
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:
82 82
83 // Accessors 83 // Accessors
84 84
85 inline T& operator* () const { return *m_ptr; } 85 inline T& operator* () const { return *m_ptr; }
86 inline T* operator-> () const { return m_ptr; } 86 inline T* operator-> () const { return m_ptr; }
87 inline T* get() const { return m_ptr; } 87 inline T* get() const { return m_ptr; }
88 inline explicit operator bool () const { return m_ptr != nullptr; }
88 89
89 // Operators 90 // Operators
90 91