swig/Examples/test-suite/template_array_numeric.i
Dave Beazley 0050ff503f new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4993 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-08-11 19:20:31 +00:00

28 lines
419 B
OpenEdge ABL

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