%module template_static %warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo; /* Ruby, wrong class name */ %warnfilter(SWIGWARN_RUBY_WRONG_NAME) foo; /* Ruby, wrong class name */ %inline %{ template class foo { public: static int test; }; template int foo::test = 0; %} %template(foo_i) foo; %template(foo_d) foo; %inline %{ namespace toto { class Foo { public: template static double bar(int i) { return 1.0; } private: int i; }; } %} %template(bar_double) toto::Foo::bar;