%module valuewrapper_base %inline %{ namespace oss { enum Polarization { UnaryPolarization, BinaryPolarization }; struct Base { }; template struct Interface_ : Base { Interface_(const Base& b) { }; }; template Result make() { return Result(*new Base()); } } %} namespace oss { // Interface %template(Interface_BP) Interface_; %template(make_Interface_BP) make >; }