swig/Examples/test-suite/operator_pointer_ref.i
Stefan Zager 71a7a52b16 Test case for bug 3285386
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12638 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-12 16:35:09 +00:00

21 lines
280 B
OpenEdge ABL

%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;
};
%}