1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-05 20:14:57 +00:00

AK: Add is_owned() method to MaybeOwned

This commit is contained in:
MacDue 2023-11-17 22:56:33 +00:00 committed by Alexander Kalenik
parent 69afb43922
commit da00a5cdb5

View File

@ -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;
};