summaryrefslogtreecommitdiff
path: root/AK/NonnullOwnPtr.h
diff options
context:
space:
mode:
Diffstat (limited to 'AK/NonnullOwnPtr.h')
-rw-r--r--AK/NonnullOwnPtr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h
index 5fa314b927..6e3f3b5963 100644
--- a/AK/NonnullOwnPtr.h
+++ b/AK/NonnullOwnPtr.h
@@ -143,12 +143,16 @@ private:
T* m_ptr = nullptr;
};
+#if !defined(KERNEL)
+
template<typename T>
inline NonnullOwnPtr<T> adopt_own(T& object)
{
return NonnullOwnPtr<T>(NonnullOwnPtr<T>::Adopt, object);
}
+#endif
+
template<class T, class... Args>
inline NonnullOwnPtr<T>
make(Args&&... args)
@@ -180,6 +184,8 @@ struct Formatter<NonnullOwnPtr<T>> : Formatter<const T*> {
}
+#if !defined(KERNEL)
using AK::adopt_own;
+#endif
using AK::make;
using AK::NonnullOwnPtr;