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
This commit is contained in:
Jeff Sharkey 2017-09-13 11:04:06 -06:00
parent 2827106d7d
commit 147b881ca9
1 changed files with 4 additions and 3 deletions

View File

@ -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