fix smart_pointer + extend

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6835 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-12-06 06:58:41 +00:00
commit bffe7fd9c7
6 changed files with 72 additions and 11 deletions

View file

@ -0,0 +1,50 @@
%module smart_pointer_extend
%inline %{
class CBase
{
};
class CDerived : public CBase
{
};
class CPtr
{
public:
CDerived* operator->(void) {return 0;};
};
%}
%extend CBase {
int foo(void) {return 1;};
}
%extend CDerived {
int foo(void) {return 2;};
}
%extend Foo
{
int extension(int i, int j) { return i; }
int extension(int i) { return i; }
int extension() { return 1; }
}
%inline %{
struct Foo {
};
class Bar {
Foo *f;
public:
Bar(Foo *f) : f(f) { }
Foo *operator->() {
return f;
}
};
%}