mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:04:57 +00:00
AK: Hide the infallible make<T> factory function from the Kernel
This function has no users, nor should it ever be used in the kernel, as all allocation failures in the Kernel should be explicitly checked.
This commit is contained in:
parent
7933a9b6c8
commit
ba0a2a3e2f
1 changed files with 3 additions and 3 deletions
|
@ -159,8 +159,6 @@ inline NonnullOwnPtr<T> adopt_own(T& object)
|
|||
return NonnullOwnPtr<T>(NonnullOwnPtr<T>::Adopt, object);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template<class T, class... Args>
|
||||
requires(IsConstructible<T, Args...>) inline NonnullOwnPtr<T> make(Args&&... args)
|
||||
{
|
||||
|
@ -174,6 +172,8 @@ inline NonnullOwnPtr<T> make(Args&&... args)
|
|||
return NonnullOwnPtr<T>(NonnullOwnPtr<T>::Adopt, *new T { forward<Args>(args)... });
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
struct Traits<NonnullOwnPtr<T>> : public GenericTraits<NonnullOwnPtr<T>> {
|
||||
using PeekType = T*;
|
||||
|
@ -200,6 +200,6 @@ struct Formatter<NonnullOwnPtr<T>> : Formatter<const T*> {
|
|||
|
||||
#if !defined(KERNEL)
|
||||
using AK::adopt_own;
|
||||
#endif
|
||||
using AK::make;
|
||||
#endif
|
||||
using AK::NonnullOwnPtr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue