add inplace test

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5857 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-04-09 21:56:14 +00:00
commit 74eb5b7dc3
3 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,31 @@
%module inplaceadd
%inline %{
struct A
{
int val;
A(int v): val(v)
{
}
A& operator+=(int v)
{
val += v;
return *this;
}
A& operator-=(int v)
{
val -= v;
return *this;
}
A& operator*=(int v)
{
val *= v;
return *this;
}
};
%}