Add some notes about \%extend and constructors
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11573 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
10edc69383
commit
a717dbd10b
1 changed files with 4 additions and 0 deletions
|
|
@ -2388,6 +2388,10 @@ You can make a <tt>Vector</tt> look a lot like a class by writing a SWIG interfa
|
|||
<p>
|
||||
Note the usage of the <tt>$self</tt> special variable.
|
||||
Its usage is identical to a C++ 'this' pointer and should be used whenever access to the struct instance is required.
|
||||
Also note that C++ constructor and destructor syntax has been used to simulate a constructor and destructor, even for C code.
|
||||
There is one subtle difference to a normal C++ constructor implementation though and that is although the constructor declaration
|
||||
is as per a normal C++ constructor, the newly constructed object must be returned <b>as if</b> the constructor declaration
|
||||
had a return value, a <tt>Vector *</tt> in this case.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue