Files
cpp-thirdparty/winx64/bin/swigwin-4.0.0/Examples/test-suite/inplaceadd.i
2019-08-04 21:38:19 -05:00

41 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;
}
};
%}