From: John McCall Date: Mon, 4 Apr 2016 18:33:00 +0000 (+0000) Subject: Add a couple of convenience operations to CharUnits. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e5edc1c573523da86b291bda3d1406ab1e4ea0b;p=clang Add a couple of convenience operations to CharUnits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265323 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/CharUnits.h b/include/clang/AST/CharUnits.h index 3a819d5ed6..b2da51c23b 100644 --- a/include/clang/AST/CharUnits.h +++ b/include/clang/AST/CharUnits.h @@ -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; }