diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2013-09-03 23:58:05 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2013-09-03 23:58:05 +0100 |
commit | f47075ec991716733d7e3588aea5e58673c004ff (patch) | |
tree | badd6ccf2d8c2c55a07eb826a8aa35658e2c89d3 /Doc/Manual | |
parent | 67659773ccfd927ca86b35c31c7bb338532c2729 (diff) | |
download | swig-f47075ec991716733d7e3588aea5e58673c004ff.tar.gz |
Smart pointer documentation improvement
Diffstat (limited to 'Doc/Manual')
-rw-r--r-- | Doc/Manual/SWIGPlus.html | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/Manual/SWIGPlus.html b/Doc/Manual/SWIGPlus.html index 716882f53..2713725d7 100644 --- a/Doc/Manual/SWIGPlus.html +++ b/Doc/Manual/SWIGPlus.html @@ -4433,7 +4433,7 @@ around some other class. For example: template<class T> class SmartPtr { T *pointee; public: - ... + SmartPtr(T *p) : pointee(p) { ... } T *operator->() { return pointee; } @@ -4453,7 +4453,7 @@ typedef SmartPtr<Foo_Impl> Foo; // Create smart pointer Foo Foo make_Foo() { - return SmartPtr(new Foo_Impl()); + return SmartPtr<Foo_Impl>(new Foo_Impl()); } // Do something with smart pointer Foo @@ -4461,6 +4461,9 @@ void do_something(Foo f) { printf("x = %d\n", f->x); f->bar(); } + +// Call the wrapped smart pointer proxy class in the target language 'Foo' +%template(Foo) SmartPtr<Foo_Impl>; </pre> </div> |