/trunk/Examples/test-suite/operator_pointer_ref.i
# · Swig · 21 lines · 16 code · 5 blank · 0 comment · 0 complexity · f74f3f5910b155506bb32edf9e3c5e5c MD5 · raw file
- %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;
- };
- %}