mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:47:35 +00:00
AK: Allow constructing WeakPtr<T> using OptionalNone
The Jakt runtime requires this.
This commit is contained in:
parent
96b36203a2
commit
c373c2deb0
1 changed files with 10 additions and 0 deletions
10
AK/WeakPtr.h
10
AK/WeakPtr.h
|
@ -18,6 +18,16 @@ class [[nodiscard]] WeakPtr {
|
||||||
public:
|
public:
|
||||||
WeakPtr() = default;
|
WeakPtr() = default;
|
||||||
|
|
||||||
|
template<SameAs<OptionalNone> V>
|
||||||
|
WeakPtr(V) { }
|
||||||
|
|
||||||
|
template<SameAs<OptionalNone> V>
|
||||||
|
WeakPtr& operator=(V)
|
||||||
|
{
|
||||||
|
clear();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename U>
|
template<typename U>
|
||||||
WeakPtr(WeakPtr<U> const& other)
|
WeakPtr(WeakPtr<U> const& other)
|
||||||
requires(IsBaseOf<T, U>)
|
requires(IsBaseOf<T, U>)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue