summaryrefslogtreecommitdiff
path: root/AK/Weakable.h
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@serenityos.org>2022-03-17 11:29:46 -0600
committerBrian Gianforcaro <b.gianfo@gmail.com>2022-03-17 22:15:42 -0700
commit2844f7c3332f84f147763413406c6f70d99ea14f (patch)
tree7828ecd3936b3305dbe3719479d2a937a2847ea3 /AK/Weakable.h
parent8f7219c6fafb4941d4cd1f094fb43e32e101299f (diff)
downloadserenity-2844f7c3332f84f147763413406c6f70d99ea14f.zip
Everywhere: Switch from EnableIf to requires
C++20 provides the `requires` clause which simplifies the ability to limit overload resolution. Prefer it over `EnableIf` With all uses of `EnableIf` being removed, also remove the implementation so future devs are not tempted.
Diffstat (limited to 'AK/Weakable.h')
-rw-r--r--AK/Weakable.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/AK/Weakable.h b/AK/Weakable.h
index 0aad3cb436..122fb6ddfa 100644
--- a/AK/Weakable.h
+++ b/AK/Weakable.h
@@ -32,8 +32,9 @@ class WeakLink : public RefCounted<WeakLink> {
friend class WeakPtr;
public:
- template<typename T, typename PtrTraits = RefPtrTraits<T>, typename EnableIf<IsBaseOf<RefCountedBase, T>>::Type* = nullptr>
+ template<typename T, typename PtrTraits = RefPtrTraits<T>>
RefPtr<T, PtrTraits> strong_ref() const
+ requires(IsBaseOf<RefCountedBase, T>)
{
RefPtr<T, PtrTraits> ref;