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)
llvm-svn: 265323

clang/include/clang/AST/CharUnits.h

index 3a819d5..b2da51c 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;
       }