Test case for bug 3285386
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12638 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cade0f6533
commit
71a7a52b16
1 changed files with 21 additions and 0 deletions
21
Examples/test-suite/operator_pointer_ref.i
Normal file
21
Examples/test-suite/operator_pointer_ref.i
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
%module operator_pointer_ref
|
||||
|
||||
%rename(AsCharStarRef) operator char*&;
|
||||
|
||||
%inline %{
|
||||
class MyClass {
|
||||
public:
|
||||
MyClass (const char *s_ = "")
|
||||
: s(strdup(s_ ? s_ : ""))
|
||||
{ }
|
||||
|
||||
~MyClass ()
|
||||
{ free(s); }
|
||||
|
||||
operator char*&()
|
||||
{ return s; }
|
||||
|
||||
private:
|
||||
char *s;
|
||||
};
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue