Bug 1276550 - Support operator-> for RangedPtr. r=Waldo
authorBoris Chiou <boris.chiou@gmail.com>
Mon, 30 May 2016 11:55:57 +0800
changeset 300309 30a1d2e8e043b12528839525e119565bec135fbe
parent 300308 c5c9bc65a408fa0c26ec742c0950b6fc484cb635
child 300310 d3cf9f70e5feb246ea2fea7bb10e493651a1409a
push id30309
push usercbook@mozilla.com
push dateFri, 03 Jun 2016 10:00:40 +0000
treeherdermozilla-central@e27fe24a746f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1276550
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1276550 - Support operator-> for RangedPtr. r=Waldo MozReview-Commit-ID: EiOfo7ly34P
mfbt/RangedPtr.h
--- a/mfbt/RangedPtr.h
+++ b/mfbt/RangedPtr.h
@@ -215,16 +215,23 @@ public:
 
   T& operator*() const
   {
     MOZ_ASSERT(mPtr >= mRangeStart);
     MOZ_ASSERT(mPtr < mRangeEnd);
     return *mPtr;
   }
 
+  T* operator->() const
+  {
+    MOZ_ASSERT(mPtr >= mRangeStart);
+    MOZ_ASSERT(mPtr < mRangeEnd);
+    return mPtr;
+  }
+
   template <typename U>
   bool operator==(const RangedPtr<U>& aOther) const
   {
     return mPtr == aOther.mPtr;
   }
   template <typename U>
   bool operator!=(const RangedPtr<U>& aOther) const
   {