Bug 1276550 - Support operator-> for RangedPtr. r=Waldo
authorBoris Chiou <boris.chiou@gmail.com>
Mon, 30 May 2016 11:55:57 +0800
changeset 341312 30a1d2e8e043b12528839525e119565bec135fbe
parent 341311 c5c9bc65a408fa0c26ec742c0950b6fc484cb635
child 341313 d3cf9f70e5feb246ea2fea7bb10e493651a1409a
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [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
   {