%module member_template %{ #ifdef max #undef max #endif %} %inline %{ template T max(T x, T y, T z) { return (x > y) ? x : y; } template class Foo { public: template S max(S x, S y) { return (x > y) ? x : y; } }; %} %extend Foo { %template(maxi) max; %template(maxd) max; }; %template(Fooint) Foo; %template(Foodouble) Foo;