git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7689 626c5289-ae23-0410-ae9c-e8d60b6d4f22
40 lines
446 B
OpenEdge ABL
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;
|
|
}
|
|
};
|
|
%}
|