PageRenderTime 11ms CodeModel.GetById 10ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/rel-1-3-26/SWIG/Examples/test-suite/python/inplaceadd.i

#
Swig | 31 lines | 25 code | 6 blank | 0 comment | 0 complexity | 9d007785493e97817e2a2ebd70132472 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1%module inplaceadd
 2
 3
 4%inline %{
 5  struct A 
 6  {
 7    int val;
 8    
 9    A(int v): val(v)
10    {
11    }
12    
13    A& operator+=(int v) 
14    {
15      val += v;
16      return *this;
17    }
18
19    A& operator-=(int v) 
20    {
21      val -= v;
22      return *this;
23    }
24
25    A& operator*=(int v) 
26    {
27      val *= v;
28      return *this;
29    }
30  };
31%}