Work around a limitation of the Python binding generator related to the += family of operators.

This commit is contained in:
Emmanuel Julien 2016-02-23 11:26:33 +01:00
commit 2730ac9c8f

View file

@ -114,11 +114,11 @@ public:
return *this;
}
// +=,-=... are member fns
void operator+=(const Op& o){ i+=o.i;}
void operator-=(const Op& o){ i-=o.i;}
void operator*=(const Op& o){ i*=o.i;}
void operator/=(const Op& o){ i/=o.i;}
void operator%=(const Op& o){ i%=o.i;}
Op &operator+=(const Op& o){ i+=o.i; return *this; }
Op &operator-=(const Op& o){ i-=o.i; return *this; }
Op &operator*=(const Op& o){ i*=o.i; return *this; }
Op &operator/=(const Op& o){ i/=o.i; return *this; }
Op &operator%=(const Op& o){ i%=o.i; return *this; }
// the +,-,*,... are friends
// (just to make life harder)
friend Op operator+(const Op& a,const Op& b){return Op(a.i+b.i);}