new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4993 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
16bede8227
commit
0050ff503f
2 changed files with 29 additions and 0 deletions
|
|
@ -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 \
|
||||
|
|
|
|||
28
Examples/test-suite/template_array_numeric.i
Normal file
28
Examples/test-suite/template_array_numeric.i
Normal 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>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue