зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
9c03689307
Коммит
123e1631f7
|
@ -237,6 +237,7 @@ public:
|
||||||
RefPtr(const RefPtr& aOther) : mPtr(ref(aOther.mPtr)) {}
|
RefPtr(const RefPtr& aOther) : mPtr(ref(aOther.mPtr)) {}
|
||||||
MOZ_IMPLICIT RefPtr(const TemporaryRef<T>& aOther) : mPtr(aOther.take()) {}
|
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(already_AddRefed<T>&& aOther) : mPtr(aOther.take()) {}
|
||||||
MOZ_IMPLICIT RefPtr(T* aVal) : mPtr(ref(aVal)) {}
|
MOZ_IMPLICIT RefPtr(T* aVal) : mPtr(ref(aVal)) {}
|
||||||
|
|
||||||
template<typename U>
|
template<typename U>
|
||||||
|
@ -259,6 +260,11 @@ public:
|
||||||
assign(aOther.take());
|
assign(aOther.take());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
RefPtr& operator=(already_AddRefed<T>&& aOther)
|
||||||
|
{
|
||||||
|
assign(aOther.take());
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
RefPtr& operator=(T* aVal)
|
RefPtr& operator=(T* aVal)
|
||||||
{
|
{
|
||||||
assign(ref(aVal));
|
assign(ref(aVal));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче