git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4993 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-08-11 19:20:31 +00:00
commit 0050ff503f
2 changed files with 29 additions and 0 deletions

View file

@ -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 \

View file

@ -0,0 +1,28 @@
%module template_array_numeric
%typemap(arginit) const float[ANY] (float temp[$1_dim0]) { }
%inline %{
template <int Len>
class Arrayf
{
float a[Len];
public:
Arrayf() {}
Arrayf(const float l[Len]) { };
};
template <int Len>
Arrayf<Len> make_arrayf(const float l[Len])
{
Arrayf<Len> a(l);
return a;
}
typedef Arrayf<4> Array4f;
%}
%template(Array4f) Arrayf<4>;
%template(make_array4f) make_arrayf<4>;