summaryrefslogtreecommitdiff
path: root/Examples/test-suite/typemap_various.i
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2005-04-01 19:49:20 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2005-04-01 19:49:20 +0000
commit46d334cae26ae2764278613f742b555f816997d8 (patch)
tree190531e4238ef9b324fa32c5e4267781fcde8d43 /Examples/test-suite/typemap_various.i
parent16fb7dc3b9c89a7a79938cab717d46264b350d5d (diff)
downloadswig-46d334cae26ae2764278613f742b555f816997d8.tar.gz
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/SWIG@7132 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/typemap_various.i')
-rw-r--r--Examples/test-suite/typemap_various.i23
1 files changed, 23 insertions, 0 deletions
diff --git a/Examples/test-suite/typemap_various.i b/Examples/test-suite/typemap_various.i
new file mode 100644
index 000000000..ac69958a6
--- /dev/null
+++ b/Examples/test-suite/typemap_various.i
@@ -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) {}
+%}
+