diff --git a/SWIG/Examples/test-suite/template_default_arg.i b/SWIG/Examples/test-suite/template_default_arg.i index 73e014f41..2bb264605 100644 --- a/SWIG/Examples/test-suite/template_default_arg.i +++ b/SWIG/Examples/test-suite/template_default_arg.i @@ -95,3 +95,26 @@ %template(ottint) ott; // default arg requires a rename %template(ottstring) ott; // default arg requires a rename + +// Above test in namespaces +%inline %{ +namespace OuterSpace { + namespace InnerSpace { + // Templated methods which are overloaded and have default args, and %template which + // uses the same name as the C++ functions and overload on the template parameters and + // specialization thrown in too. Wow, SWIG can handle this insane stuff! + template int nsott(T t = 0, const U& u = U()) { return 110; } + template int nsott(const char *msg, T t = 0, const U& u = U()) { return 120; } + int nsott(Foo) { return 130; } + template int nsott(Hello h, T t = 0) { return 140; } + template<> int nsott(Hello h, int t) { return 150; } + template<> int nsott(Hello h, double t) { return 160; } + } +} +%} + +%template(nsott) OuterSpace::InnerSpace::nsott; +%template(nsott) OuterSpace::InnerSpace::nsott; +%template(nsottint) OuterSpace::InnerSpace::nsott; // default arg requires a rename +%template(nsottstring) OuterSpace::InnerSpace::nsott; // default arg requires a rename +