AK: Add WeakPtr::operator T*() for ergonomy.

This commit is contained in:
Andreas Kling 2019-04-14 02:15:43 +02:00
parent 91e1f3ffb1
commit 2dbece54f5

View file

@ -35,6 +35,9 @@ public:
T& operator*() { return *ptr(); }
const T& operator*() const { return *ptr(); }
operator const T*() const { return ptr(); }
operator T*() { return ptr(); }
bool is_null() const { return !m_link || !m_link->ptr(); }
void clear() { m_link = nullptr; }