PageRenderTime 44ms CodeModel.GetById 18ms 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. %inline %{
  3. struct A
  4. {
  5. int val;
  6. A(int v): val(v)
  7. {
  8. }
  9. A& operator+=(int v)
  10. {
  11. val += v;
  12. return *this;
  13. }
  14. A& operator-=(int v)
  15. {
  16. val -= v;
  17. return *this;
  18. }
  19. A& operator*=(int v)
  20. {
  21. val *= v;
  22. return *this;
  23. }
  24. };
  25. %}