1 2 3 4 5 6 7 8 9 10 11
%module conversion %rename(toFoo) Bar::operator Foo(); %inline %{ struct Foo { }; struct Bar { operator Foo () { return Foo(); } }; %}