dwww Home | Show directory contents | Find package

%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;
    }
  };
%}

Generated by dwww version 1.15 on Tue Jul 2 00:14:17 CEST 2024.