add test case for template+typedef+typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6526 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7437e0896d
commit
0b2cb3849f
1 changed files with 42 additions and 0 deletions
42
Examples/test-suite/template_typemaps.i
Normal file
42
Examples/test-suite/template_typemaps.i
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
%module template_typemap
|
||||
|
||||
|
||||
%typemap(in) Integer
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
%typemap(out) Integer
|
||||
{
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
%{
|
||||
typedef int Integer;
|
||||
%}
|
||||
|
||||
|
||||
%inline %{
|
||||
|
||||
template <class T>
|
||||
struct Foo
|
||||
{
|
||||
T val;
|
||||
|
||||
T get_val() const
|
||||
{
|
||||
return val;
|
||||
}
|
||||
|
||||
void set_val(T v)
|
||||
{
|
||||
val = v;
|
||||
}
|
||||
};
|
||||
%}
|
||||
|
||||
%template(Foo_i) Foo<int>;
|
||||
%template(Foo_I) Foo<Integer>;
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue