diff options
author | Marcelo Matus <mmatus@acms.arizona.edu> | 2004-12-07 23:32:11 +0000 |
---|---|---|
committer | Marcelo Matus <mmatus@acms.arizona.edu> | 2004-12-07 23:32:11 +0000 |
commit | c5f1c1bdf9a035b675c3e1b5dfcf7d3179e9343e (patch) | |
tree | 6b01e1fdcfa5578c8188c335ed659eca54722301 /Examples/test-suite/smart_pointer_extend.i | |
parent | 1d9ee1ed57be6a5a64b280923429eb27896f70bf (diff) | |
download | swig-c5f1c1bdf9a035b675c3e1b5dfcf7d3179e9343e.tar.gz |
more smart_pointer fixes + cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6844 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/smart_pointer_extend.i')
-rw-r--r-- | Examples/test-suite/smart_pointer_extend.i | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/Examples/test-suite/smart_pointer_extend.i b/Examples/test-suite/smart_pointer_extend.i index 402aecac8..61eeaebfd 100644 --- a/Examples/test-suite/smart_pointer_extend.i +++ b/Examples/test-suite/smart_pointer_extend.i @@ -1,32 +1,53 @@ %module smart_pointer_extend %inline %{ + namespace hi + { + struct CBase + { + static int hello() + { + return 1; + } + }; -class CBase -{ -}; + class CDerived : public CBase + { + }; -class CDerived : public CBase -{ -}; + class CPtr + { + public: + CDerived* operator->(void) {return 0;}; + }; -class CPtr -{ -public: - CDerived* operator->(void) {return 0;}; -}; + int get_hello(CPtr ptr) + { + return ptr->hello(); + } + class CPtrConst + { + public: + CDerived* operator->(void) const {return 0;}; + }; + + } + %} -%extend CBase { +%extend hi::CBase { int foo(void) {return 1;}; + int bar(void) {return 2;}; + int boo(int i) {return i;}; } -%extend CDerived { - int foo(void) {return 2;}; +%extend hi::CDerived { + int foo(void) {return 1;}; } + %extend Foo { int extension(int i, int j) { return i; } |