mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 03:24:58 +00:00
AK: Add is_owned() method to MaybeOwned
This commit is contained in:
parent
69afb43922
commit
da00a5cdb5
1 changed files with 2 additions and 0 deletions
|
@ -54,6 +54,8 @@ public:
|
|||
T& operator*() { return *ptr(); }
|
||||
T const& operator*() const { return *ptr(); }
|
||||
|
||||
bool is_owned() const { return m_handle.template has<NonnullOwnPtr<T>>(); }
|
||||
|
||||
private:
|
||||
Variant<NonnullOwnPtr<T>, T*> m_handle;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue