%module template_specialization %rename(not1) *::operator!() const; %rename(negate) *::operator-() const; %inline %{ namespace vfncs { template struct UnaryFunction { UnaryFunction operator-() const { return *this; } }; template <> struct UnaryFunction { // This works // UnaryFunction operator!() const; // This doesn't UnaryFunction operator!() const { return *this; } // Does this? void foo(UnaryFunction) { } }; } %} namespace vfncs { %template(UnaryFunction_double) UnaryFunction; %template(UnaryFunction_bool) UnaryFunction; }