Kernel: Remove the infallible make_ref_counted<T> factory function
This function had no users, nor should it ever be used, as all allocation failures in the Kernel should be explicitly checked.
This commit is contained in:
parent
a65bbbdb71
commit
3dc8bbbc8b
Notes:
sideshowbarker
2024-07-17 19:49:41 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/3dc8bbbc8bb Pull-request: https://github.com/SerenityOS/serenity/pull/12275
1 changed files with 0 additions and 13 deletions
|
@ -336,18 +336,6 @@ inline void swap(NonnullRefPtr<T>& a, NonnullRefPtr<U>& b) requires(IsConvertibl
|
|||
a.swap(b);
|
||||
}
|
||||
|
||||
template<typename T, class... Args>
|
||||
requires(IsConstructible<T, Args...>) inline NonnullRefPtr<T> make_ref_counted(Args&&... args)
|
||||
{
|
||||
return NonnullRefPtr<T>(NonnullRefPtr<T>::Adopt, *new T(forward<Args>(args)...));
|
||||
}
|
||||
|
||||
// FIXME: Remove once P0960R3 is available in Clang.
|
||||
template<typename T, class... Args>
|
||||
inline NonnullRefPtr<T> make_ref_counted(Args&&... args)
|
||||
{
|
||||
return NonnullRefPtr<T>(NonnullRefPtr<T>::Adopt, *new T { forward<Args>(args)... });
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
@ -359,5 +347,4 @@ struct Traits<NonnullRefPtr<T>> : public GenericTraits<NonnullRefPtr<T>> {
|
|||
};
|
||||
|
||||
using AK::adopt_ref;
|
||||
using AK::make_ref_counted;
|
||||
using AK::NonnullRefPtr;
|
||||
|
|
Loading…
Add table
Reference in a new issue