test %template() with no given template name uses typemaps - tests part of the template ext mode

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7132 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-04-01 19:49:20 +00:00
commit 2a48aace86
2 changed files with 24 additions and 0 deletions

View file

@ -282,6 +282,7 @@ CPP_TEST_CASES += \
typemap_ns_using \
typemap_numinputs \
typemap_variables \
typemap_various \
typename \
union_scope \
using1 \

View file

@ -0,0 +1,23 @@
%module typemap_various
%typemap(in) SWIGTYPE "_this_will_not_compile_SWIGTYPE_"
%typemap(in) const SWIGTYPE & "_this_will_not_compile_const_SWIGTYPE_REF_"
%inline %{
template <class T> struct Foo {
#ifdef SWIG
// These typemaps should be used by foo1 and foo2
%typemap(in) Foo<T> "/*in typemap for Foo<T> */"
%typemap(in) const Foo & "/*in typemap for const Foo&, with type T*/"
#endif
};
%}
%template(FooInt) Foo<int>;
%template() Foo<short>; // previously Foo<short> typemaps were being picked up for Python only
%inline %{
void foo1(Foo<int> f, const Foo<int>& ff) {}
void foo2(Foo<short> f, const Foo<short>& ff) {}
%}