Fix postfix operator++ operation

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8255 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-01-06 16:32:21 +00:00
commit e364bc65e1

View file

@ -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: <<,<<=
};