more smart pointers + extend fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6918 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
aba193e439
commit
d1f4bec910
3 changed files with 42 additions and 2 deletions
|
|
@ -22,3 +22,13 @@ if b.hello() != p.hello():
|
|||
|
||||
|
||||
|
||||
d = DFoo()
|
||||
|
||||
dp = DPtrFoo(d)
|
||||
|
||||
if d.SExt(1) != dp.SExt(1):
|
||||
raise RuntimeError
|
||||
|
||||
if d.Ext(1) != dp.Ext(1):
|
||||
raise RuntimeError
|
||||
|
||||
|
|
|
|||
|
|
@ -97,3 +97,32 @@ public:
|
|||
%}
|
||||
|
||||
|
||||
|
||||
%inline %{
|
||||
|
||||
class DFoo;
|
||||
|
||||
class DPtrFoo
|
||||
{
|
||||
DFoo *p;
|
||||
public:
|
||||
DPtrFoo(DFoo *ptr) : p(ptr)
|
||||
{
|
||||
}
|
||||
|
||||
DFoo* operator->(void) {return p;};
|
||||
};
|
||||
|
||||
class DFoo
|
||||
{
|
||||
public:
|
||||
void F(void) {};
|
||||
};
|
||||
|
||||
%}
|
||||
|
||||
|
||||
%extend DFoo {
|
||||
static int SExt(int i = 1) {return i;};
|
||||
int Ext(int i = 2) {return i;};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue