From 0050ff503f2e2cf626df50fa641fd2ca37817170 Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Mon, 11 Aug 2003 19:20:31 +0000 Subject: [PATCH] new test git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4993 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/common.mk | 1 + Examples/test-suite/template_array_numeric.i | 28 ++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Examples/test-suite/template_array_numeric.i diff --git a/Examples/test-suite/common.mk b/Examples/test-suite/common.mk index f38c3b40b..038bc31ec 100644 --- a/Examples/test-suite/common.mk +++ b/Examples/test-suite/common.mk @@ -174,6 +174,7 @@ CPP_TEST_CASES += \ static_const_member_2 \ struct_value \ template \ + template_array_numeric \ template_arg_replace \ template_arg_scope \ template_arg_typename \ diff --git a/Examples/test-suite/template_array_numeric.i b/Examples/test-suite/template_array_numeric.i new file mode 100644 index 000000000..72340c59a --- /dev/null +++ b/Examples/test-suite/template_array_numeric.i @@ -0,0 +1,28 @@ +%module template_array_numeric + +%typemap(arginit) const float[ANY] (float temp[$1_dim0]) { } + +%inline %{ + +template +class Arrayf +{ + float a[Len]; + public: + Arrayf() {} + Arrayf(const float l[Len]) { }; +}; + +template +Arrayf make_arrayf(const float l[Len]) +{ + Arrayf a(l); + return a; +} + +typedef Arrayf<4> Array4f; + +%} + +%template(Array4f) Arrayf<4>; +%template(make_array4f) make_arrayf<4>;