blob: 91ef84bd24c4ea6ee9f9c0049bfe6d70c85c557a [file] [log] [blame]
%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;
}
};
%}