%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 >; }