mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
AK: Make NonnullRefPtr::operator=(NonnullRefPtr<U>&&) cast incoming pointer.
Same as the RefPtr issue I just fixed. This makes it possible to assign a NonnullRefPtr<Derived>&& to a NonnullRefPtr<Base>.
This commit is contained in:
parent
dea7f937bf
commit
20c6edc976
Notes:
sideshowbarker
2024-07-19 13:06:24 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/20c6edc9766
1 changed files with 1 additions and 1 deletions
|
@ -136,7 +136,7 @@ public:
|
|||
{
|
||||
if (this != static_cast<void*>(&other)) {
|
||||
deref_if_not_null(m_ptr);
|
||||
m_ptr = &other.leak_ref();
|
||||
m_ptr = static_cast<T*>(&other.leak_ref());
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue