aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Dyck <kd@kendyck.com>2011-03-19 01:25:59 +0000
committerKen Dyck <kd@kendyck.com>2011-03-19 01:25:59 +0000
commitf899af662801ee6bb82be871eb0b8d19b61503ba (patch)
tree5ace20ba606897671340bf4f3ac6e69613b9f83c
parent47226350c4f8094cf2ebe750351b2b3242709584 (diff)
Add pre- and post-increment/decrement operators to CharUnits.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127937 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/CharUnits.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/clang/AST/CharUnits.h b/include/clang/AST/CharUnits.h
index cf909e8822..5bfa19dd74 100644
--- a/include/clang/AST/CharUnits.h
+++ b/include/clang/AST/CharUnits.h
@@ -70,10 +70,24 @@ namespace clang {
Quantity += Other.Quantity;
return *this;
}
+ CharUnits& operator++ () {
+ ++Quantity;
+ return *this;
+ }
+ CharUnits operator++ (int) {
+ return CharUnits(Quantity++);
+ }
CharUnits& operator-= (const CharUnits &Other) {
Quantity -= Other.Quantity;
return *this;
}
+ CharUnits& operator-- () {
+ --Quantity;
+ return *this;
+ }
+ CharUnits operator-- (int) {
+ return CharUnits(Quantity--);
+ }
// Comparison operators.
bool operator== (const CharUnits &Other) const {