mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 10:05:32 +00:00
AK: Add WeakPtr::operator T*() for ergonomy.
This commit is contained in:
parent
91e1f3ffb1
commit
2dbece54f5
|
@ -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; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue