mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1161627 - part 1 - add move constructor and assignment operator for already_AddRefed&& to RefPtr; r=ehsan
This change is prep work for future mass rewriting.
This commit is contained in:
parent
2e6c0723a0
commit
0bd78f32c5
@ -237,6 +237,7 @@ public:
|
||||
RefPtr(const RefPtr& aOther) : mPtr(ref(aOther.mPtr)) {}
|
||||
MOZ_IMPLICIT RefPtr(const TemporaryRef<T>& aOther) : mPtr(aOther.take()) {}
|
||||
MOZ_IMPLICIT RefPtr(already_AddRefed<T>& aOther) : mPtr(aOther.take()) {}
|
||||
MOZ_IMPLICIT RefPtr(already_AddRefed<T>&& aOther) : mPtr(aOther.take()) {}
|
||||
MOZ_IMPLICIT RefPtr(T* aVal) : mPtr(ref(aVal)) {}
|
||||
|
||||
template<typename U>
|
||||
@ -259,6 +260,11 @@ public:
|
||||
assign(aOther.take());
|
||||
return *this;
|
||||
}
|
||||
RefPtr& operator=(already_AddRefed<T>&& aOther)
|
||||
{
|
||||
assign(aOther.take());
|
||||
return *this;
|
||||
}
|
||||
RefPtr& operator=(T* aVal)
|
||||
{
|
||||
assign(ref(aVal));
|
||||
|
Loading…
Reference in New Issue
Block a user