Files
cpp-thirdparty/winx64/bin/swig-3.0.12/Examples/test-suite/inplaceadd.i
Bassem Girgis 81b4b9e273 Initial commit
2018-12-20 17:34:07 -06: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;
}
};
%}