diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h index c3a78a6ff58c17077f1e897735422c10e9b00d19..c34b09de2fdec7e439a4e16f2607ab47ab8ff938 100644 --- a/AK/NonnullOwnPtr.h +++ b/AK/NonnullOwnPtr.h @@ -167,6 +167,12 @@ private: T* m_ptr = nullptr; }; +template +inline NonnullOwnPtr adopt_own(T& object) +{ + return NonnullOwnPtr(NonnullOwnPtr::Adopt, object); +} + template inline NonnullOwnPtr make(Args&&... args) @@ -195,5 +201,6 @@ inline void swap(NonnullOwnPtr& a, NonnullOwnPtr& b) } +using AK::adopt_own; using AK::make; using AK::NonnullOwnPtr;