diff --git a/Lib/shared_ptr.i b/Lib/shared_ptr.i index 450493db4..2975b0628 100644 --- a/Lib/shared_ptr.i +++ b/Lib/shared_ptr.i @@ -4,6 +4,13 @@ // to use a pointer to the smart pointer of the type, rather than the usual pointer to the underlying type. // So for some type T, shared_ptr * is used rather than T *. +// Another key part of the implementation is the smartptr feature: +// %feature("smartptr") T { shared_ptr } +// This feature marks the class T as having a smartptr to it (the shared_ptr type). This is then used to +// support smart pointers and inheritance. Say class D derives from base B, then shared_ptr is marked +// with a fake inheritance from shared_ptr in the type system if the "smartptr" feature is used on both +// B and D. This is to emulate the conversion of shared_ptr to shared_ptr in the target language. + // shared_ptr namespaces could be boost or std or std::tr1 // For example for std::tr1, use: // #define SWIG_SHARED_PTR_NAMESPACE std