Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > 3c88344d1f3d15057277d028d0022277 > files > 823

swig-1.3.11-4mdk.i586.rpm

// This file tests SWIG pass/return by value for
// a class with no default constructor

%module cpp_nodefault
%inline %{

class Foo {
public:
   Foo(int x, int y) { }
};

Foo create(int x, int y) {
    return Foo(x,y);
}

typedef Foo Foo_t;

void consume(Foo f, Foo_t g) {
}


%}

%{
Foo gvar = Foo(3,4);
%}

Foo gvar;