LibGC: Add missing & in Weak assignment
The Weak<T>::operator=(U const&) template incorrectly compares the internal pointer directly against the `other` reference. If this template is instantiated, it causes a compilation error because a Ptr<T> cannot be compared directly to a U const&
This commit is contained in:
parent
f146294b23
commit
d7c90639ae
1 changed files with 1 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ template<typename U>
|
|||
Weak<T>& Weak<T>::operator=(U const& other)
|
||||
requires(IsConvertible<U*, T*>)
|
||||
{
|
||||
if (ptr() != other) {
|
||||
if (ptr() != &other) {
|
||||
m_impl = *other.heap().create_weak_impl(const_cast<void*>(static_cast<void const*>(&other)));
|
||||
}
|
||||
return *this;
|
||||
|
|
|
|||
Loading…
Reference in a new issue