/* Tests the use of %template with namespaces */ %module namespace_template %warnfilter(SWIGWARN_RUBY_WRONG_NAME) vector; /* Ruby, wrong class name */ %warnfilter(SWIGWARN_RUBY_WRONG_NAME) test2::vector; /* Ruby, wrong class name */ %warnfilter(SWIGWARN_RUBY_WRONG_NAME) test3::vector; /* Ruby, wrong class name */ %warnfilter(SWIGWARN_RUBY_WRONG_NAME) 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"; } }; } namespace test2 { using namespace test; } namespace test3 { using test::max; using test::vector; } using namespace test2; namespace T4 = test; %} 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"; } }; } using namespace test; %template(maxint) max; %template(vectorint) vector; namespace test2 { using namespace test; %template(maxshort) max; %template(vectorshort) vector; } namespace test3 { using test::max; using test::vector; %template(maxlong) max; %template(vectorlong) vector; } %inline %{ namespace test4 { using namespace test; typedef int Integer; } %} namespace test4 { %template(maxInteger) max; %template(vectorInteger) vector; }