diff options
author | Nico Weber <thakis@chromium.org> | 2023-02-11 06:37:21 -0500 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2023-02-11 08:53:00 -0500 |
commit | 0c4bbf5be33546fb43a52c41359dc8064a195374 (patch) | |
tree | 62c967af14c430caaef0a5a3a46adea2ea94cf6c /AK/RefPtr.h | |
parent | 3c842d9d761ea04c9175668699e1a3aa4fced0ce (diff) | |
download | serenity-0c4bbf5be33546fb43a52c41359dc8064a195374.zip |
AK: Move try_make_ref_counted() to NonnullRefPtr.h
Diffstat (limited to 'AK/RefPtr.h')
-rw-r--r-- | AK/RefPtr.h | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/AK/RefPtr.h b/AK/RefPtr.h index 528cf7c38c..1c28a07d9a 100644 --- a/AK/RefPtr.h +++ b/AK/RefPtr.h @@ -328,24 +328,10 @@ inline RefPtr<T> adopt_ref_if_nonnull(T* object) return {}; } -template<typename T, class... Args> -requires(IsConstructible<T, Args...>) inline ErrorOr<NonnullRefPtr<T>> try_make_ref_counted(Args&&... args) -{ - return adopt_nonnull_ref_or_enomem(new (nothrow) T(forward<Args>(args)...)); -} - -// FIXME: Remove once P0960R3 is available in Clang. -template<typename T, class... Args> -inline ErrorOr<NonnullRefPtr<T>> try_make_ref_counted(Args&&... args) -{ - return adopt_nonnull_ref_or_enomem(new (nothrow) T { forward<Args>(args)... }); -} - } #if USING_AK_GLOBALLY using AK::adopt_ref_if_nonnull; using AK::RefPtr; using AK::static_ptr_cast; -using AK::try_make_ref_counted; #endif |