/* Tests the use of %template with namespaces */ %module namespace_template %warnfilter(SWIGWARN_RUBY_WRONG_NAME) test::vector; /* Ruby, wrong class name */ %warnfilter(SWIGWARN_RUBY_WRONG_NAME) test::vector; /* Ruby, wrong class name */ %warnfilter(SWIGWARN_RUBY_WRONG_NAME) test::vector; /* Ruby, wrong class name */ %warnfilter(SWIGWARN_RUBY_WRONG_NAME) test::vector; /* Ruby, wrong class name */ %{ #ifdef max #undef max #endif %} %{ namespace test { template T max(T a, T b) { return (a > b) ? a : b; } template class vector { public: vector() { } ~vector() { } char * blah(T x) { return (char *) "vector::blah"; } void vectoruse(vector a, test::vector b) {} }; } %} namespace test { template T max(T a, T b) { return (a > b) ? a : b; } template class vector { public: vector() { } ~vector() { } char * blah(T x) { return (char *) "vector::blah"; } void vectoruse(vector a, test::vector b) {} }; } using namespace test; %template(maxint) max; %template(vectorint) vector; namespace test { %template(maxshort) max; %template(vectorshort) vector; } namespace test { %template(maxlong) max; %template(vectorlong) vector; } %inline %{ namespace test { typedef char Char; } %} namespace test { %template(maxchar) max; %template(vectorchar) vector; }