From: Ken Dyck Date: Sat, 19 Mar 2011 01:25:59 +0000 (+0000) Subject: Add pre- and post-increment/decrement operators to CharUnits. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f899af662801ee6bb82be871eb0b8d19b61503ba;p=clang 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 --- 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 {