r265323 - Add a couple of convenience operations to CharUnits.
John McCall via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 4 11:33:00 PDT 2016
Author: rjmccall
Date: Mon Apr 4 13:33:00 2016
New Revision: 265323
URL: http://llvm.org/viewvc/llvm-project?rev=265323&view=rev
Log:
Add a couple of convenience operations to CharUnits.
Modified:
cfe/trunk/include/clang/AST/CharUnits.h
Modified: cfe/trunk/include/clang/AST/CharUnits.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CharUnits.h?rev=265323&r1=265322&r2=265323&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/CharUnits.h (original)
+++ cfe/trunk/include/clang/AST/CharUnits.h Mon Apr 4 13:33:00 2016
@@ -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;
}
More information about the cfe-commits
mailing list