add more cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7770 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4cda422fe3
commit
5da979283b
2 changed files with 21 additions and 2 deletions
|
|
@ -9,14 +9,25 @@
|
||||||
static int sfoo(int a = 1, int b = 0) { return a + b; }
|
static int sfoo(int a = 1, int b = 0) { return a + b; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%newobject Foo::create;
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
struct Foo
|
struct Foo
|
||||||
{
|
{
|
||||||
Foo(int a, int b = 0){}
|
Foo(int a, int b = 0) {}
|
||||||
|
|
||||||
int foo(int a = 1, int b = 0) {return a + b; }
|
virtual int foo(int a = 1, int b = 0) {return a + b; }
|
||||||
static int statfoo(int a = 1, int b = 0) {return a + b; }
|
static int statfoo(int a = 1, int b = 0) {return a + b; }
|
||||||
|
|
||||||
|
static Foo *create(int a = 1, int b = 0)
|
||||||
|
{
|
||||||
|
return new Foo(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~Foo(){
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,14 @@
|
||||||
from kwargs import *
|
from kwargs import *
|
||||||
|
|
||||||
|
class MyFoo(Foo):
|
||||||
|
def __init__(self, a , b = 0):
|
||||||
|
Foo.__init__(self, a, b)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Simple class
|
# Simple class
|
||||||
|
f1 = MyFoo(2)
|
||||||
|
|
||||||
f = Foo(b=2,a=1)
|
f = Foo(b=2,a=1)
|
||||||
|
|
||||||
if f.foo(b=1,a=2) != 3:
|
if f.foo(b=1,a=2) != 3:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue