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>;