From c373c2deb0ee1f3c4643cd2f041ff850a1d39a0d Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sat, 10 Dec 2022 19:37:34 +0330 Subject: [PATCH] AK: Allow constructing WeakPtr using OptionalNone The Jakt runtime requires this. --- AK/WeakPtr.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/AK/WeakPtr.h b/AK/WeakPtr.h index c6d3dc545d..ad94755de9 100644 --- a/AK/WeakPtr.h +++ b/AK/WeakPtr.h @@ -18,6 +18,16 @@ class [[nodiscard]] WeakPtr { public: WeakPtr() = default; + template V> + WeakPtr(V) { } + + template V> + WeakPtr& operator=(V) + { + clear(); + return *this; + } + template WeakPtr(WeakPtr const& other) requires(IsBaseOf)