mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:07:34 +00:00
AK: Add WeakPtr::operator T*() for ergonomy.
This commit is contained in:
parent
91e1f3ffb1
commit
2dbece54f5
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue