Bug 1208829 - static_assert that IntRegionTyped is instantiated with a proper unit type. r=mstange
authorBotond Ballo <botond@mozilla.com>
Mon, 09 Nov 2015 20:34:33 -0500
changeset 308672 c2cf3f48bf13825bc6107a63d4baad1911dc6528
parent 308671 679df006697208909599c1603077dc4a0cd92bc0
child 308673 c6430d27fad9edd9027788f0f1093e3de2034d97
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1208829
milestone45.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 1208829 - static_assert that IntRegionTyped is instantiated with a proper unit type. r=mstange
gfx/src/nsRegion.h
--- a/gfx/src/nsRegion.h
+++ b/gfx/src/nsRegion.h
@@ -831,16 +831,18 @@ class IntRegionTyped :
     public BaseIntRegion<IntRegionTyped<units>, IntRectTyped<units>, IntPointTyped<units>, IntMarginTyped<units>>
 {
   typedef BaseIntRegion<IntRegionTyped<units>, IntRectTyped<units>, IntPointTyped<units>, IntMarginTyped<units>> Super;
 
   // Make other specializations of IntRegionTyped friends.
   template <typename OtherUnits>
   friend class IntRegionTyped;
 
+  static_assert(IsPixel<units>::value, "'units' must be a coordinate system tag");
+
 public:
   // Forward constructors.
   IntRegionTyped() {}
   MOZ_IMPLICIT IntRegionTyped(const IntRectTyped<units>& aRect) : Super(aRect) {}
   IntRegionTyped(const IntRegionTyped& aRegion) : Super(aRegion) {}
   IntRegionTyped(IntRegionTyped&& aRegion) : Super(mozilla::Move(aRegion)) {}
 
   // Assignment operators need to be forwarded as well, otherwise the compiler