Author: kjdyck
Date: Fri Mar 18 20:25:59 2011
New Revision: 127937

URL: http://llvm.org/viewvc/llvm-project?rev=127937&view=rev
Log:
Add pre- and post-increment/decrement operators 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=127937&r1=127936&r2=127937&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/CharUnits.h (original)
+++ cfe/trunk/include/clang/AST/CharUnits.h Fri Mar 18 20:25:59 2011
@@ -70,10 +70,24 @@
         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 {


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to