Skip to content

Commit

Permalink
Add a couple of convenience operations to CharUnits.
Browse files Browse the repository at this point in the history
llvm-svn: 265323
  • Loading branch information
rjmccall committed Apr 4, 2016
1 parent 80fc4bc commit b8fa654
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions clang/include/clang/AST/CharUnits.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b8fa654

Please sign in to comment.