MODE: INLINE struct Base06 { virtual const char* method() { return "from base"; } virtual ~Base06() { } }; struct Derived06A: public Base06 { virtual const char* method() { return "from derived-A"; } const char* specific_method() { return "specific-A"; } }; struct Derived06B: public Base06 { virtual const char* method() { return "from derived-B"; } const char* specific_method() { return "specific-B"; } }; namespace xs { template struct Typemap : TypemapObject { static std::string package () { return "MyTest::Cookbook::Base04"; } }; template <> struct Typemap : Typemap { static std::string package () { return "MyTest::Cookbook::Derived06A"; } }; template <> struct Typemap : Typemap { static std::string package () { return "MyTest::Cookbook::Derived06B"; } }; } MODULE = MyTest::Cookbook PACKAGE = MyTest::Cookbook::Base06 PROTOTYPES: DISABLE const char* Base06::method() Base06* Base06::new() MODULE = MyTest::Cookbook PACKAGE = MyTest::Cookbook::Derived06A PROTOTYPES: DISABLE Derived06A* Derived06A::new() const char* Derived06A::specific_method() BOOT { Stash(__PACKAGE__).inherit("MyTest::Cookbook::Base06"); } MODULE = MyTest::Cookbook PACKAGE = MyTest::Cookbook::Derived06B PROTOTYPES: DISABLE Derived06B* Derived06B::new() const char* Derived06B::specific_method() BOOT { Stash(__PACKAGE__).inherit("MyTest::Cookbook::Base06"); }