From 6c07923bf580b29148a5c758f187e004668c4c3f Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 6 Jan 2006 16:32:21 +0000 Subject: [PATCH] Fix postfix operator++ operation git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8255 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/operator_overload.i | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Examples/test-suite/operator_overload.i b/Examples/test-suite/operator_overload.i index 901197dcc..935b0fd8b 100644 --- a/Examples/test-suite/operator_overload.i +++ b/Examples/test-suite/operator_overload.i @@ -63,7 +63,6 @@ see bottom for a set of possible tests class Op{ public: int i; - int j; Op(int a=0):i(a) {} Op(const Op& o):i(o.i) @@ -109,10 +108,10 @@ public: int operator()(int a,int b){return i+a+b;} // increment/decrement operators - Op& operator++(){++i; return *this;} // prefix ++ - Op operator++(int){return Op(i++);} // postfix ++ - Op& operator--(){--i; return *this;} // prefix -- - Op operator--(int){return Op(i++);} // postfix -- + Op& operator++() {++i; return *this;} // prefix ++ + Op operator++(int) {Op o = *this; ++(*this); return o;} // postfix ++ + Op& operator--() {--i; return *this;} // prefix -- + Op operator--(int) {Op o = *this; --(*this); return o;} // postfix -- // TODO: <<,<<= };