use $self special variable instead of self in %extend
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9533 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
80f1901570
commit
65c52f7c06
20 changed files with 52 additions and 52 deletions
|
|
@ -20,7 +20,7 @@
|
|||
%extend Complex {
|
||||
char *str() {
|
||||
static char temp[512];
|
||||
sprintf(temp,"(%g,%g)", self->re(), self->im());
|
||||
sprintf(temp,"(%g,%g)", $self->re(), $self->im());
|
||||
return temp;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ public:
|
|||
/* This wrapper provides an alternative to the [] operator */
|
||||
%extend {
|
||||
Vector &get(int index) {
|
||||
return (*self)[index];
|
||||
return (*$self)[index];
|
||||
}
|
||||
void set(int index, Vector &a) {
|
||||
(*self)[index] = a;
|
||||
(*$self)[index] = a;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue