swig/Examples/test-suite/python/inplaceadd.i
2005-10-19 14:26:13 +00:00

40 lines
446 B
OpenEdge ABL

%module inplaceadd
%{
#include <iostream>
%}
%inline %{
struct A
{
int val;
A(int v): val(v)
{
}
A& operator+=(int v)
{
val += v;
return *this;
}
A& operator+=(const A& a)
{
val += a.val;
return *this;
}
A& operator-=(int v)
{
val -= v;
return *this;
}
A& operator*=(int v)
{
val *= v;
return *this;
}
};
%}