new test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4993 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8449ac5b3a
commit
3ce8356c2b
2 changed files with 29 additions and 0 deletions
|
|
@ -174,6 +174,7 @@ CPP_TEST_CASES += \
|
||||||
static_const_member_2 \
|
static_const_member_2 \
|
||||||
struct_value \
|
struct_value \
|
||||||
template \
|
template \
|
||||||
|
template_array_numeric \
|
||||||
template_arg_replace \
|
template_arg_replace \
|
||||||
template_arg_scope \
|
template_arg_scope \
|
||||||
template_arg_typename \
|
template_arg_typename \
|
||||||
|
|
|
||||||
28
SWIG/Examples/test-suite/template_array_numeric.i
Normal file
28
SWIG/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