1 %module conversion_namespace 2 %rename(toFoo) oss::Bar::operator Foo(); 3 4 %inline %{ 5 namespace oss 6 { 7 struct Foo { 8 }; 9 struct Bar { FooBar10 operator Foo () { return Foo(); } 11 }; 12 } 13 %} 14 15