mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 10:05:32 +00:00
AK: Allow constructing WeakPtr<T> using OptionalNone
The Jakt runtime requires this.
This commit is contained in:
parent
96b36203a2
commit
c373c2deb0
10
AK/WeakPtr.h
10
AK/WeakPtr.h
|
@ -18,6 +18,16 @@ class [[nodiscard]] WeakPtr {
|
|||
public:
|
||||
WeakPtr() = default;
|
||||
|
||||
template<SameAs<OptionalNone> V>
|
||||
WeakPtr(V) { }
|
||||
|
||||
template<SameAs<OptionalNone> V>
|
||||
WeakPtr& operator=(V)
|
||||
{
|
||||
clear();
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
WeakPtr(WeakPtr<U> const& other)
|
||||
requires(IsBaseOf<T, U>)
|
||||
|
|
Loading…
Reference in a new issue