mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
AK: Add is_owned() method to MaybeOwned
This commit is contained in:
parent
69afb43922
commit
da00a5cdb5
Notes:
sideshowbarker
2024-07-16 20:44:03 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/da00a5cdb5 Pull-request: https://github.com/SerenityOS/serenity/pull/21977 Reviewed-by: https://github.com/timschumi
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
Reference in a new issue