Add pre- and post-increment/decrement operators to CharUnits.
llvm-svn: 127937
This commit is contained in:
parent
5c07daaa1d
commit
54d4d9fb19
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue