]> granicus.if.org Git - clang/commitdiff
Add a couple of convenience operations to CharUnits.
authorJohn McCall <rjmccall@apple.com>
Mon, 4 Apr 2016 18:33:00 +0000 (18:33 +0000)
committerJohn McCall <rjmccall@apple.com>
Mon, 4 Apr 2016 18:33:00 +0000 (18:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265323 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/CharUnits.h

index 3a819d5ed63f5f911c89112d6e5bff977f3a3874..b2da51c23b85cf77efaa3b011816f152d36afe29 100644 (file)
@@ -142,9 +142,17 @@ namespace clang {
       CharUnits operator* (QuantityType N) const {
         return CharUnits(Quantity * N);
       }
+      CharUnits &operator*= (QuantityType N) {
+        Quantity *= N;
+        return *this;
+      }
       CharUnits operator/ (QuantityType N) const {
         return CharUnits(Quantity / N);
       }
+      CharUnits operator/= (QuantityType N) {
+        Quantity /= N;
+        return *this;
+      }
       QuantityType operator/ (const CharUnits &Other) const {
         return Quantity / Other.Quantity;
       }