Bug 1162335 - Remove already_AddRefed::MatchNullptr. r?froydnj
MozReview-Commit-ID: 1hxUm9xdNhK
--- a/mfbt/AlreadyAddRefed.h
+++ b/mfbt/AlreadyAddRefed.h
@@ -62,20 +62,17 @@ struct MOZ_MUST_USE_TYPE MOZ_NON_AUTOABL
* this behavior through the default constructor.
*
* We can revert to simply explicit (T*) and implicit (decltype(nullptr)) when
* nullptr no longer needs to be emulated to support the ancient b2g compiler.
* (The () overload could also be removed, if desired, if we changed callers.)
*/
already_AddRefed() : mRawPtr(nullptr) {}
- // The return and argument types here are arbitrarily selected so no
- // corresponding member function exists.
- typedef void (already_AddRefed::* MatchNullptr)(double, float);
- MOZ_IMPLICIT already_AddRefed(MatchNullptr aRawPtr) : mRawPtr(nullptr) {}
+ MOZ_IMPLICIT already_AddRefed(decltype(nullptr)) : mRawPtr(nullptr) {}
explicit already_AddRefed(T* aRawPtr) : mRawPtr(aRawPtr) {}
// Disallow copy constructor and copy assignment operator: move semantics used instead.
already_AddRefed(const already_AddRefed<T>& aOther) = delete;
already_AddRefed<T>& operator=(const already_AddRefed<T>& aOther) = delete;
already_AddRefed(already_AddRefed<T>&& aOther) : mRawPtr(aOther.take()) {}